Use configured AWS credentials for docs assembly #1531
This file contains hidden or 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 site | |
| on: | |
| schedule: | |
| - cron: "0 9 * * *" | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| - "pull-request/[0-9]+" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| defaults: | |
| run: | |
| shell: bash | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| build: | |
| name: Build (and deploy) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 | |
| with: | |
| enable-cache: true | |
| - name: Install dependencies | |
| run: uv sync --locked | |
| - name: Build and validate portal | |
| run: make check | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708 # v5.1.1 | |
| with: | |
| role-to-assume: ${{ vars.AWS_ROLE_ARN }} | |
| aws-region: ${{ vars.AWS_REGION }} | |
| role-duration-seconds: 7200 | |
| - name: Assemble complete documentation site | |
| run: make assemble | |
| - name: Deploy site | |
| env: | |
| NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_API_TOKEN }} | |
| NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DOCS_SITE_ID }} | |
| run: | | |
| # TODO: use the official netlify-cli package after | |
| # https://github.com/netlify/cli/issues/1809 is resolved and deployed. | |
| npm install --global --force @aschmidt8/netlify-cli | |
| ARGS="" | |
| if [ "$GITHUB_REF_NAME" = "main" ]; then | |
| ARGS="--prod" | |
| fi | |
| netlify deploy "$ARGS" \ | |
| --debug \ | |
| --dir=_site |