diff --git a/.github/workflows/nonproduction.yaml b/.github/workflows/nonproduction.yaml new file mode 100644 index 00000000..e0555e1a --- /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-9ef4a0b762dcef7b0865fb8ab-nonprodbucket-mvc0s1gcxhnt + 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..d56767b4 --- /dev/null +++ b/.github/workflows/production.yaml @@ -0,0 +1,32 @@ +name: Deploy site production bucket + +on: + push: + branches: + - main + +jobs: + + build: + runs-on: ubuntu-latest + env: + BUCKET_NAME: cfst-3457-9ef4a0b762dcef7b0865fb8abf91-prodbucket-1khbt0et5ilnd + 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