Merge pull request #354 from GeoscienceAustralia/Validation-Quart-Tem… #327
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to Production | |
on: | |
workflow_dispatch: | |
repository_dispatch: | |
types: [publish-notebooks-to-knowledge-hub] # Triggered by the dea-notebooks repository: https://github.com/GeoscienceAustralia/dea-notebooks/blob/develop/.github/workflows/trigger_docs.yaml | |
push: | |
branches: [main] | |
permissions: | |
id-token: write # For requesting the JWT used by OIDC Authentication | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.11"] | |
node-version: [18.x] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Pull latest from submodules | |
run: git submodule foreach git pull origin stable | |
- name: Install Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: ./install-dependencies.sh | |
- name: Build site | |
env: | |
BUILD_MODE: production | |
run: ./build-production.sh | |
- name: Configure AWS credentials via OIDC | |
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
role-to-assume: arn:aws:iam::538673716275:role/github-actions-dea-knowledge-hub | |
aws-region: ap-southeast-2 | |
- name: Deploy site | |
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' | |
env: | |
DISTRIBUTION_ID: ${{ secrets.DISTRIBUTION_ID }} | |
run: ./deploy-production.sh |