diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..c363e6b --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,33 @@ +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