File tree Expand file tree Collapse file tree 3 files changed +23
-47
lines changed
Expand file tree Collapse file tree 3 files changed +23
-47
lines changed Original file line number Diff line number Diff line change @@ -30,11 +30,11 @@ jobs:
3030 - name : Build
3131 run : |
3232 npm ci && npm run build
33- cp dist/index.html dist/404.html
3433
35- - name : Update pages artifact
36- uses : actions/upload-pages- artifact@v3
34+ - name : Update dist artifact
35+ uses : actions/upload-artifact@v3
3736 with :
37+ name : package
3838 path : dist/
3939
4040 - name : Run tests
@@ -51,13 +51,26 @@ jobs:
5151 deploy :
5252 needs : build
5353 permissions :
54- pages : write
5554 id-token : write
56- environment :
57- name : github-pages
58- url : ${{ steps.deployment.outputs.page_url }}
5955 runs-on : ubuntu-latest
56+ env :
57+ version : ${{needs.build.outputs.version}}
6058 steps :
61- - name : Deploy to GitHub Pages
62- id : deployment
63- uses : actions/deploy-pages@v4
59+ - name : Create OIDC token to AWS
60+ uses : aws-actions/configure-aws-credentials@v4
61+ with :
62+ audience : sts.amazonaws.com
63+ aws-region : us-east-1
64+ role-to-assume : arn:aws:iam::${{ secrets.AWS_ACCOUNT }}:role/${{ secrets.CI_IAM_ROLE }}
65+
66+ - name : Download dist artifact
67+ uses : actions/download-artifact@v4
68+ with :
69+ name : package
70+ path : dist/
71+
72+ - name : Push to AWS S3
73+ run : |
74+ echo Deploying $version
75+ aws s3 cp dist s3://${{ secrets.APP_BUCKET }} --recursive
76+ aws cloudfront create-invalidation --distribution-id ${{ secrets.DISTRIBUTION_ID }} --paths "/*"
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments