diff --git a/.github/workflows/nonproduction.yaml b/.github/workflows/nonproduction.yaml new file mode 100644 index 00000000..38272c73 --- /dev/null +++ b/.github/workflows/nonproduction.yaml @@ -0,0 +1,32 @@ +name: Deploy feature branches to nonproduction bucket + +on: + push: + branches: + - feature* + +jobs: + + build: + runs-on: ubuntu-latest + env: + BUCKET_NAME: cfst-3457-a173605ed2bc43a0ae5184bcc-nonprodbucket-gwgg26a4b1e9 + steps: + - name: Check out code + uses: actions/checkout@v2 + - name: configure aws cli + 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: us-east-1 + - name: set up node.js + uses: actions/setup-node@v2 + with: + node-version: 14 + - name: build site + run: | + npm ci + npm run build + - name: deploy files to bucket + run: aws s3 cp public s3://${{ env.BUCKET_NAME }} --recursive --acl public-read \ No newline at end of file diff --git a/.github/workflows/production.yaml b/.github/workflows/production.yaml new file mode 100644 index 00000000..388ac8dc --- /dev/null +++ b/.github/workflows/production.yaml @@ -0,0 +1,32 @@ +name: Deploy site to production bucket + +on: + push: + branches: + - main + +jobs: + + build: + runs-on: ubuntu-latest + env: + BUCKET_NAME: cfst-3457-a173605ed2bc43a0ae5184bcc3bc-prodbucket-1rzxhclwdq6sj + steps: + - name: Check out code + uses: actions/checkout@v2 + - name: configure aws cli + uses: 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: us-east-1 + - name: set up node js + uses: actions/setup-node@v2 + with: + node-version: 14 + - name: build site + run: | + npm ci + npm run build + - name: deploy files to bucket + run: aws s3 cp public s3://${{ env.BUCKET_NAME }} --recursive --acl public-read \ No newline at end of file