-
-
Notifications
You must be signed in to change notification settings - Fork 6
76 lines (64 loc) · 1.95 KB
/
Copy pathdocs.yml
File metadata and controls
76 lines (64 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Docs
on:
pull_request:
paths:
- 'docs-fumadocs/**'
- '.github/workflows/docs.yml'
push:
branches:
- main
paths:
- 'docs-fumadocs/**'
- '.github/workflows/docs.yml'
workflow_dispatch:
inputs: {}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: docs-fumadocs/package-lock.json
- name: Install docs dependencies
run: npm ci
working-directory: docs-fumadocs
- name: Run docs quality checks
run: npm run ci:check
working-directory: docs-fumadocs
- name: Upload docs site
uses: actions/upload-artifact@v4
with:
name: docs-site
path: docs-fumadocs/out
deploy:
needs: build
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download docs site
uses: actions/download-artifact@v4
with:
name: docs-site
path: out
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "24"
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Deploy to S3
run: aws s3 sync ./out s3://${{ secrets.AWS_S3_BUCKET }} --delete
- name: Invalidating CloudFront cache
run: |
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*"