From 291acc21addb68174e6e8f1de50d976443c3503f Mon Sep 17 00:00:00 2001 From: Oakley Jurgens Date: Fri, 29 Aug 2025 09:25:48 +1200 Subject: [PATCH 1/4] WIP (cherry picked from commit 92f9a48bd9b8ca7005a5369d9f8ca14d6bbb4efb) --- .github/workflows/deploy-to-aws.yaml | 73 +++------------------------- .github/workflows/dev.yml | 2 + 2 files changed, 10 insertions(+), 65 deletions(-) diff --git a/.github/workflows/deploy-to-aws.yaml b/.github/workflows/deploy-to-aws.yaml index d2bbac8..4793102 100644 --- a/.github/workflows/deploy-to-aws.yaml +++ b/.github/workflows/deploy-to-aws.yaml @@ -10,70 +10,13 @@ on: workflow_dispatch: jobs: - call-test-workflow: - uses: GNS-Science/nshm-github-actions/.github/workflows/python-run-tests.yml@main + # call-test-workflow: + # uses: ./.github/workflows/dev.yml + # secrets: inherit + + call-deploy-workflow: + # needs: call-test-workflow + uses: GNS-Science/nshm-github-actions/.github/workflows/deploy-to-aws.yml@feature/16-deploy-to-aws with: - operating-systems: "['ubuntu-latest']" - python-versions: "['3.10']" + python-version: '3.10' secrets: inherit - - deploy: - needs: call-test-workflow - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [20] - python-version: ['3.10'] - - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Install and configure Poetry - uses: GNS-Science/install-poetry@main - with: - virtualenvs-create: true - virtualenvs-in-project: true - installer-parallel: true - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - check-latest: true - - - name: upgrade NPM - run: npm install --location=global npm@latest - - # - name: Verify NPM - # run: npm doctor - - - name: Install Dependencies - run: npm install - - - name: List packages - run: npm ls - - - name: Serverless Doctor - run: npm run-script sls_doctor - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ap-southeast-2 - - - name: Serverless Deploy .... - env: - ENABLE_METRICS: 0 - run: | - poetry self add poetry-plugin-export - if [[ "${{github.base_ref}}" == "main" || "${{github.ref}}" == 'refs/heads/main' ]]; then - STAGE=prod npm run-script deploy - else - STAGE=test npm run-script deploy - fi - diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 4bc2677..2ab2a6a 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -8,6 +8,8 @@ on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: + # Allows us to call the workflow from another workflow + workflow_call: jobs: call-test-workflow: From 78e285e02343ca571d6d421d29e2aedc34440849 Mon Sep 17 00:00:00 2001 From: Oakley Jurgens Date: Fri, 29 Aug 2025 10:28:51 +1200 Subject: [PATCH 2/4] WIP --- .github/workflows/deploy-to-aws.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-to-aws.yaml b/.github/workflows/deploy-to-aws.yaml index 4793102..c29e987 100644 --- a/.github/workflows/deploy-to-aws.yaml +++ b/.github/workflows/deploy-to-aws.yaml @@ -10,9 +10,9 @@ on: workflow_dispatch: jobs: - # call-test-workflow: - # uses: ./.github/workflows/dev.yml - # secrets: inherit + call-test-workflow: + uses: ./.github/workflows/dev.yml + secrets: inherit call-deploy-workflow: # needs: call-test-workflow From ff371baa6b38cf5e096fef3d4a77c52ba3a38196 Mon Sep 17 00:00:00 2001 From: Oakley Jurgens Date: Fri, 29 Aug 2025 10:30:19 +1200 Subject: [PATCH 3/4] correct dependency --- .github/workflows/deploy-to-aws.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-to-aws.yaml b/.github/workflows/deploy-to-aws.yaml index c29e987..693f87c 100644 --- a/.github/workflows/deploy-to-aws.yaml +++ b/.github/workflows/deploy-to-aws.yaml @@ -15,7 +15,7 @@ jobs: secrets: inherit call-deploy-workflow: - # needs: call-test-workflow + needs: call-test-workflow uses: GNS-Science/nshm-github-actions/.github/workflows/deploy-to-aws.yml@feature/16-deploy-to-aws with: python-version: '3.10' From 9c078ac9895029e14a40f61ecbaedd240669f507 Mon Sep 17 00:00:00 2001 From: Oakley Jurgens Date: Fri, 29 Aug 2025 11:49:27 +1200 Subject: [PATCH 4/4] WIP --- .github/workflows/deploy-to-aws.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-to-aws.yaml b/.github/workflows/deploy-to-aws.yaml index 693f87c..b67ffd6 100644 --- a/.github/workflows/deploy-to-aws.yaml +++ b/.github/workflows/deploy-to-aws.yaml @@ -16,7 +16,7 @@ jobs: call-deploy-workflow: needs: call-test-workflow - uses: GNS-Science/nshm-github-actions/.github/workflows/deploy-to-aws.yml@feature/16-deploy-to-aws + uses: GNS-Science/nshm-github-actions/.github/workflows/deploy-to-aws.yml@main with: python-version: '3.10' secrets: inherit