ci: changes to run s3 sync pipeline #2
This file contains hidden or 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 S3 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| env: | |
| AWS_BUCKET_NAME: ftr-rocketseat-upload-widget-web-static | |
| SOURCE_FOLDER: ./dist | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| id: checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Node | |
| id: install-node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install pnpm | |
| id: install-pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - name: Install dependencies | |
| id: install-dependencies | |
| run: | | |
| pnpm install --frozen-lockfile | |
| - name: Config AWS Credentials | |
| id: config-aws-credentials | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| aws-region: ${{ vars.AWS_REGION }} | |
| - name: Config AWS S3 sync | |
| id: config-aws-s2-sync | |
| run: | | |
| aws s3 sync ${{ env.SOURCE_FOLDER }} s3://${{ env.AWS_BUCKET_NAME }} --delete |