.github/workflows/static-deploy.yaml #4
Workflow file for this run
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 to static hosting | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| environment: | |
| description: Environment to deploy to. | |
| default: docs-dev | |
| required: true | |
| type: environment | |
| push: | |
| permissions: | |
| contents: read | |
| id-token: write | |
| jobs: | |
| build: | |
| name: Build site | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: true | |
| - name: Copy assets from submodules | |
| run: rsync -av --progress */**/docs/assets/ docs/assets --exclude .git --exclude .idea --exclude docs | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.x | |
| - name: Create cache ID | |
| run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV | |
| - name: Cache Python dependencies | |
| uses: actions/cache@v5 | |
| with: | |
| key: mkdocs-material-${{ env.cache_id }} | |
| path: .cache | |
| restore-keys: | | |
| mkdocs-material- | |
| - name: Install python dependencies | |
| run: | | |
| pip install \ | |
| mkdocs-material \ | |
| markdown-callouts \ | |
| mdx_truly_sane_lists \ | |
| mkdocs-nav-weight \ | |
| pymdown-extensions \ | |
| plantuml_markdown | |
| - name: Build site | |
| run: mkdocs build | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: site | |
| path: site/ | |
| deploy: | |
| needs: build | |
| uses: codeforamerica/shared-services-infra/.github/workflows/shared-deploy-static.yaml@static-site-support | |
| with: | |
| environment: ${{ inputs.environment }} | |
| artifact_name: site | |
| secrets: inherit |