Skip to content

docs: 2024年5月分の変更を取り込む (#138) #49

docs: 2024年5月分の変更を取り込む (#138)

docs: 2024年5月分の変更を取り込む (#138) #49

Workflow file for this run

name: Deploy to S3
on:
push:
branches:
- master
paths:
- 'postalCode/**'
- '.github/workflows/deploy.yml'
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Get yarn cache
id: yarn-cache
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Library install
run: yarn --frozen-lockfile
- name: Unit test
run: yarn run test
- name: Lint
run: yarn run lint
- name: Type check
run: yarn run type-check
- name: Commitlint
run: yarn run commitlint
- 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
- name: Deploy to S3
run: |
aws s3 sync postalCode/ s3://${{ secrets.AWS_S3_BUCKET_NAME }} --delete
- name: Cache clear
run: |
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} --paths '/*'