Skip to content

Access8Math Web Production Deploy #14

Access8Math Web Production Deploy

Access8Math Web Production Deploy #14

name: Access8Math Web Production Deploy
on:
workflow_dispatch:
inputs:
deployTag:
description: "tag to deploy"
required: true
type: string
env:
s3_bucket: "access8math-web"
origin_path: "production/${{github.event.inputs.deployTag}}"
destination_path: "production/main"
jobs:
deployment:
environment: access8math_web_production
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_GITHUB_ACTION_ROLE }}
aws-region: ap-northeast-1
- name: sync to main directory
run: |
aws s3 cp "s3://${s3_bucket}/${origin_path}" "s3://${s3_bucket}/${destination_path}" --recursive
- name: create invalidation
run: |
aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*"