Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save 0xkohe/2ce9cc174d29fae4f8ea92b8e8fd536c to your computer and use it in GitHub Desktop.
Save 0xkohe/2ce9cc174d29fae4f8ea92b8e8fd536c to your computer and use it in GitHub Desktop.
name: Deploy Production
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: yarn install
- run: yarn build
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-1
- run: aws s3 sync ./dist/ s3://${{ secrets.BUCKET_NAME }}/ --delete --exact-timestamps
- run: aws cloudfront create-invalidation --distribution-id ${{ secrets.DISTRIBUTION_ID}} --paths "/*"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment