Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 6 additions & 63 deletions .github/workflows/deploy-to-aws.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,69 +11,12 @@ on:

jobs:
call-test-workflow:
uses: GNS-Science/nshm-github-actions/.github/workflows/python-run-tests.yml@main
with:
operating-systems: "['ubuntu-latest']"
python-versions: "['3.10']"
uses: ./.github/workflows/dev.yml
secrets: inherit

deploy:
call-deploy-workflow:
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

uses: GNS-Science/nshm-github-actions/.github/workflows/deploy-to-aws.yml@main
with:
python-version: '3.10'
secrets: inherit
2 changes: 2 additions & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down