Skip to content

Commit a7d4af6

Browse files
authored
[70] Use shared workflow for deployment (#71)
1 parent 799a585 commit a7d4af6

File tree

2 files changed

+18
-59
lines changed

2 files changed

+18
-59
lines changed

.github/workflows/deploy-to-aws.yaml

Lines changed: 15 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -6,64 +6,20 @@ on:
66
- deploy-test
77
- main
88

9-
jobs:
10-
#call-test-workflow:
11-
# # https://docs.github.com/en/actions/using-workflows/reusing-workflows#calling-a-reusable-workflow
12-
# uses: ./.github/workflows/run-tests.yml
13-
14-
deploy:
15-
# needs: call-test-workflow
16-
runs-on: ubuntu-latest
17-
18-
steps:
19-
- uses: actions/checkout@v4
20-
- uses: actions/setup-python@v5
21-
with:
22-
python-version: "3.10"
23-
24-
- name: Install and configure Poetry
25-
uses: GNS-Science/install-poetry@main
26-
with:
27-
virtualenvs-create: true
28-
virtualenvs-in-project: true
29-
installer-parallel: true
30-
31-
- name: Use Node.js )
32-
uses: actions/setup-node@v4
33-
with:
34-
node-version: 20
35-
check-latest: true
36-
37-
- name: upgrade NPM
38-
run: npm install --location=global npm@latest
39-
40-
- name: Verify NPM
41-
run: npm doctor
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
4211

43-
- name: Install Dependencies
44-
run: npm install
45-
46-
- name: List packages
47-
run: npm ls
48-
49-
- name: Serverless Doctor
50-
run: npm run-script sls_doctor
51-
52-
- name: Configure AWS Credentials
53-
uses: aws-actions/configure-aws-credentials@v1
54-
with:
55-
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
56-
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
57-
aws-region: ap-southeast-2
58-
59-
- name: Serverless Deploy ....
60-
env:
61-
ENABLE_METRICS: 1
62-
COLOR_SCALE_NORMALISATION: LIN
63-
run: |
64-
if [[ "${{github.base_ref}}" == "main" || "${{github.ref}}" == 'refs/heads/main' ]]; then
65-
STAGE=prod npm run-script deploy
66-
else
67-
STAGE=test npm run-script deploy
68-
fi
12+
jobs:
6913

14+
call-test-workflow:
15+
uses: ./.github/workflows/dev.yml
16+
secrets: inherit
17+
18+
call-deploy-workflow:
19+
needs: call-test-workflow
20+
uses: GNS-Science/nshm-github-actions/.github/workflows/deploy-to-aws.yml@main
21+
with:
22+
operating-system: 'ubuntu-latest'
23+
python-version: '3.10'
24+
smoketest-query: 'query QueryRoot{about}'
25+
secrets: inherit

.github/workflows/dev.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
# Allows you to run this workflow manually from the Actions tab
1010
workflow_dispatch:
1111

12+
# Allows us to call the workflow from another workflow
13+
workflow_call:
14+
1215
jobs:
1316
call-test-workflow:
1417
uses: GNS-Science/nshm-github-actions/.github/workflows/python-run-tests.yml@main

0 commit comments

Comments
 (0)