From 846d11537171a858f7673c24a0bc9fcb285acd4a Mon Sep 17 00:00:00 2001 From: NicoMorillo Date: Fri, 10 Feb 2023 10:45:46 +0000 Subject: [PATCH 1/4] create nonproduction workflow --- .github/workflows/nonproduction.yaml | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .github/workflows/nonproduction.yaml diff --git a/.github/workflows/nonproduction.yaml b/.github/workflows/nonproduction.yaml new file mode 100644 index 00000000..e69de29b From 6b49f53e77e2af3401e7ff7d729d1be0e5a2fe7b Mon Sep 17 00:00:00 2001 From: NicoMorillo Date: Fri, 10 Feb 2023 10:48:04 +0000 Subject: [PATCH 2/4] trigger change --- .github/workflows/nonproduction.yaml | 32 ++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.github/workflows/nonproduction.yaml b/.github/workflows/nonproduction.yaml index e69de29b..09872810 100644 --- a/.github/workflows/nonproduction.yaml +++ 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-id: ${{ 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 From 9272b1741921f87e00015bb27d8b31b734466b9f Mon Sep 17 00:00:00 2001 From: NicoMorillo Date: Fri, 10 Feb 2023 10:51:00 +0000 Subject: [PATCH 3/4] aws secret --- .github/workflows/nonproduction.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nonproduction.yaml b/.github/workflows/nonproduction.yaml index 09872810..e0555e1a 100644 --- a/.github/workflows/nonproduction.yaml +++ b/.github/workflows/nonproduction.yaml @@ -18,7 +18,7 @@ jobs: uses: aws-actions/configure-aws-credentials@v1 with: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key-id: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: us-east-1 - name: set up node.js uses: actions/setup-node@v2 From ea0ae1ac514a280d7c3dd137415d2190a3fa3982 Mon Sep 17 00:00:00 2001 From: NicoMorillo Date: Fri, 10 Feb 2023 11:05:38 +0000 Subject: [PATCH 4/4] create production workflow --- .github/workflows/production.yaml | 32 +++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/production.yaml 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