From 56a6755aa2180a2f8ae4988a29d46aa2487a5f70 Mon Sep 17 00:00:00 2001 From: maksymCode <68052591+maksymCode@users.noreply.github.com> Date: Fri, 20 Oct 2023 14:50:24 +0100 Subject: [PATCH 1/5] created nonproduction workflow --- src/.github/workflows/nonproduction.yaml | 31 ++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/.github/workflows/nonproduction.yaml diff --git a/src/.github/workflows/nonproduction.yaml b/src/.github/workflows/nonproduction.yaml new file mode 100644 index 00000000..b021251c --- /dev/null +++ b/src/.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-949f655422559e8d106b98b4d-nonprodbucket-7pvku39tesht + steps: + - name: checkout code + uses: actions/checkout@v2 + - name: configure 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: use-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 From 308d06148bc58e07344ce7cd3fdea5461b8fd62f Mon Sep 17 00:00:00 2001 From: maksymCode <68052591+maksymCode@users.noreply.github.com> Date: Fri, 20 Oct 2023 14:57:36 +0100 Subject: [PATCH 2/5] moved workflows folder --- {src/.github => .github}/workflows/nonproduction.yaml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {src/.github => .github}/workflows/nonproduction.yaml (100%) diff --git a/src/.github/workflows/nonproduction.yaml b/.github/workflows/nonproduction.yaml similarity index 100% rename from src/.github/workflows/nonproduction.yaml rename to .github/workflows/nonproduction.yaml From a47ad683a0980b2b6ce3d8813625322975b720d4 Mon Sep 17 00:00:00 2001 From: maksymCode <68052591+maksymCode@users.noreply.github.com> Date: Fri, 20 Oct 2023 15:01:14 +0100 Subject: [PATCH 3/5] updated yaml file --- .github/workflows/nonproduction.yaml | 53 ++++++++++++++-------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/.github/workflows/nonproduction.yaml b/.github/workflows/nonproduction.yaml index b021251c..7d3e9284 100644 --- a/.github/workflows/nonproduction.yaml +++ b/.github/workflows/nonproduction.yaml @@ -1,31 +1,32 @@ name: Deploy feature branches to nonproduction bucket on: - push: - branches: - - feature* + push: + branches: + - feature* jobs: - build: - runs-on: ubuntu-latest - env: - BUCKET_NAME: cfst-3457-949f655422559e8d106b98b4d-nonprodbucket-7pvku39tesht - steps: - - name: checkout code - uses: actions/checkout@v2 - - name: configure 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: use-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 + + build: + runs-on: ubuntu-latest + env: + BUCKET_NAME: + 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 From 982518b8ba3d57fb404765afe5db87b9cfc0697d Mon Sep 17 00:00:00 2001 From: maksymCode <68052591+maksymCode@users.noreply.github.com> Date: Fri, 20 Oct 2023 15:03:53 +0100 Subject: [PATCH 4/5] set bucket name --- .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 7d3e9284..65b95b28 100644 --- a/.github/workflows/nonproduction.yaml +++ b/.github/workflows/nonproduction.yaml @@ -10,7 +10,7 @@ jobs: build: runs-on: ubuntu-latest env: - BUCKET_NAME: + BUCKET_NAME: cfst-3457-949f655422559e8d106b98b4d-nonprodbucket-7pvku39tesht steps: - name: Check out code uses: actions/checkout@v2 From 9b6259e985e5471b35220a623b9477b0bbd8bb26 Mon Sep 17 00:00:00 2001 From: maksymCode <68052591+maksymCode@users.noreply.github.com> Date: Fri, 20 Oct 2023 15:23:56 +0100 Subject: [PATCH 5/5] added production workflow --- .github/workflows/production.yaml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 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..b75d2d03 --- /dev/null +++ b/.github/workflows/production.yaml @@ -0,0 +1,31 @@ +name: Deploy site to roduction bucket + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + env: + BUCKET_NAME: cfst-3457-949f655422559e8d106b98b4d4db-prodbucket-1n432zlgzh0fd + 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