diff --git a/.github/workflows/nonproduction.yaml b/.github/workflows/nonproduction.yaml new file mode 100644 index 00000000..4fdc048e --- /dev/null +++ b/.github/workflows/nonproduction.yaml @@ -0,0 +1,31 @@ +name: Deploy feature branches to nonproduction bucket + +on: + push: + branches: + - feature* + +jobs: + build: + runs-on: ubuntu-latest + env: + BUCKET_NAME: cfst-3457-c96d48fc6372be40a6ae745f10-nonprodbucket-8gwraeycsxz4 + steps: + - name: checkout code + uses: actions/checkout@v2 + - name: configura aws cli + uses: aws-actions/configure-aws-credentials@v2 + 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 diff --git a/.github/workflows/production.yaml b/.github/workflows/production.yaml new file mode 100644 index 00000000..4ff081dd --- /dev/null +++ b/.github/workflows/production.yaml @@ -0,0 +1,31 @@ +name: Deploy feature branches to production bucket + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + env: + BUCKET_NAME: cfst-3457-c96d48fc6372be40a6ae745f10fd5-prodbucket-0wouspyva1k0 + steps: + - name: checkout code + uses: actions/checkout@v2 + - name: configura aws cli + uses: aws-actions/configure-aws-credentials@v2 + 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