Skip to content

Commit

Permalink
[Fix] deploy s3
Browse files Browse the repository at this point in the history
  • Loading branch information
winnieworld committed Oct 4, 2023
1 parent edb3228 commit 781de73
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,27 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install dependencies
run: yarn install # or yarn install
run: npm install # or yarn install
- name: Build production-ready SPA
run: yarn build # or yarn build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
run: npm run build # or yarn build
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./out # or the folder with your static assets
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
env:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
aws s3 rm s3://dearmydiary.com --recursive
aws s3 cp --recursive --region ap-northeast-2 ./out s3://dearmydiary.com
- name: Clear Cache to Cloudfront
env:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: aws cloudfront create-invalidation --distribution-id EU0XEQZ5TATN6 --paths "/*"

0 comments on commit 781de73

Please sign in to comment.