From 4c06d8b626251343e3e78ba5d5ea13d8a5a86870 Mon Sep 17 00:00:00 2001 From: Dimitris Zervas Date: Fri, 16 Oct 2020 23:56:04 +0300 Subject: [PATCH 1/3] Invalid syntax in deploy.yml --- .github/workflows/deploy.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 69b3466..dec08c8 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -15,12 +15,12 @@ jobs: - uses: actions/checkout@v2 - run: make test - run: make dist - + - run: make dist-deploy if: github.event_name == 'push' env: - CIRCLE_BRANCH: ${{GITHUB_REF_NAME}} + CIRCLE_BRANCH: "${GITHUB_REF_NAME}" - run: make dist-deploy if: github.event_name == 'create' env: - CIRCLE_TAG: ${{GITHUB_REF_NAME}} + CIRCLE_TAG: "${GITHUB_REF_NAME}" From 4afac426f0f83fb8f4d2095bc943cc06390bbfa7 Mon Sep 17 00:00:00 2001 From: Dimitris Zervas Date: Sat, 17 Oct 2020 00:05:28 +0300 Subject: [PATCH 2/3] Add the s3cfg secret --- .github/workflows/deploy.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index dec08c8..84dc417 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -13,14 +13,21 @@ jobs: steps: - uses: actions/checkout@v2 - - run: make test - - run: make dist + - name: Test the code (lint) + run: make test + - name: Package the code + run: make dist - - run: make dist-deploy + - name: Write the s3cfg secret + run: echo "${secrets.S3CFG}" > .s3cfg + + - name: Branch based code deployment + run: make dist-deploy if: github.event_name == 'push' env: CIRCLE_BRANCH: "${GITHUB_REF_NAME}" - - run: make dist-deploy + - name: Tag based code deployment + run: make dist-deploy if: github.event_name == 'create' env: CIRCLE_TAG: "${GITHUB_REF_NAME}" From 8bb7c1f55510443c10d2bb701b8d2a52072b1922 Mon Sep 17 00:00:00 2001 From: Dimitris Zervas Date: Sat, 17 Oct 2020 00:29:10 +0300 Subject: [PATCH 3/3] Remove s3cfg and use secrets as env vars --- .github/workflows/deploy.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 84dc417..e1162fd 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -18,16 +18,19 @@ jobs: - name: Package the code run: make dist - - name: Write the s3cfg secret - run: echo "${secrets.S3CFG}" > .s3cfg - - name: Branch based code deployment run: make dist-deploy if: github.event_name == 'push' env: CIRCLE_BRANCH: "${GITHUB_REF_NAME}" + AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }} + AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }} + AWS_SESSION_TOKEN: ${{ secrets.AWS_SESSION_TOKEN }} - name: Tag based code deployment run: make dist-deploy if: github.event_name == 'create' env: CIRCLE_TAG: "${GITHUB_REF_NAME}" + AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }} + AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }} + AWS_SESSION_TOKEN: ${{ secrets.AWS_SESSION_TOKEN }}