1- name : Docs CI/CD
1+ name : Deploy Documentation
22
33on :
44 push :
55 branches :
66 - master
7- - staging
87
98jobs :
10- build :
11- name : Deploy Docs
9+ deploy :
10+ name : Deploy Documentation
1211 runs-on : ubuntu-latest
1312 timeout-minutes : 10
1413 steps :
@@ -18,10 +17,11 @@ jobs:
1817 - name : Setup Node
1918 uses : actions/setup-node@v3
2019 with :
21- node-version : 16
20+ node-version : 18
21+ cache : ' npm'
2222
2323 - name : Install Dependencies
24- run : npm install
24+ run : npm ci
2525
2626 - name : Build Application
2727 run : npm run docs:build
@@ -38,19 +38,16 @@ jobs:
3838 append_to_pre_release_tag : prerelease
3939
4040 - name : Setup AWS Credentials
41- if : github.ref == 'refs/heads/master'
4241 uses : aws-actions/configure-aws-credentials@v1
4342 with :
4443 aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY }}
4544 aws-secret-access-key : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
4645 aws-region : us-east-1
4746
4847 - name : Deploy to S3
49- if : github.ref == 'refs/heads/master'
5048 run : aws s3 sync ./docs/.vitepress/dist/ s3://${{ secrets.AWS_BUCKET_NAME }} --delete
5149
5250 - name : Invalidate Cloudfront Cache
53- if : github.ref == 'refs/heads/master'
5451 uses : chetan/invalidate-cloudfront-action@v2
5552 env :
5653 DISTRIBUTION : ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }}
6057 AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
6158
6259 - name : Trigger Algolia Crawler Index
63- if : github.ref == 'refs/heads/master'
6460 uses : algolia/algoliasearch-crawler-github-actions@v1.0.10
6561 with :
6662 crawler-user-id : ${{ secrets.CRAWLER_USER_ID }}
7268
7369 - name : Create Release
7470 uses : ncipollo/release-action@v1
75- if : github.ref == 'refs/heads/master'
7671 with :
7772 tag : ${{ steps.tag_version.outputs.new_tag }}
7873 name : ${{ steps.tag_version.outputs.new_tag }}
79- body : ${{ steps.tag_version.outputs.changelog }}
74+ generateReleaseNotes : true
75+ makeLatest : true
76+ token : ${{ secrets.RELEASE_TOKEN }}
0 commit comments