Merge pull request #11 from GuiGou12358/main #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to AWS S3 | |
'on': | |
push: | |
branches: | |
- main | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
build_and_deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '18.x' | |
cache: 'yarn' | |
- name: Install and build | |
run: | | |
yarn install --frozen-lockfile | |
yarn build | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1.7.0 | |
with: | |
aws-region: ${{ secrets.AWS_REGION }} | |
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} | |
role-session-name: GitHubActions | |
- name: Deploy app build to S3 bucket | |
run: aws s3 sync ./build s3://astar-community-tutorials --delete |