name: CI
      on:
        push:
          branches:
            - main
      jobs:
        build:
          runs-on: ubuntu-latest
          steps:
            - uses: actions/checkout@v2
            - name: Use Node.js ${{ matrix.node-version }}
              uses: actions/setup-node@v1
              with:
                node-version: 16.x
            - name: Install dependencies
              run: |
                npm i
            - name: Production Build
              run: |
                npm run build
            - 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: ${{ secrets.AWS_REGION }}
            - name: Remove useless files
              run: rm -rf .github .git README.md
            - name: Deploy static site to S3 bucket
              run: aws s3 sync out s3://${{ secrets.S3_BUCKET }} --delete

      YAML language logo
      Build nodejs site and upload in S3

      GitHub Actions

      Build a NodeJs/NextJs website and upload it to S3

      Shortcut: nextjs.s3

      Filename pattern: .github/workflows/*.yml

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.