ekristen/gcp-nuke

View on GitHub
.github/workflows/docs.yml

Summary

Maintainability
Test Coverage
name: docs

on:
  workflow_dispatch:
  push:
    branches:
      - main
    paths:
      - docs/**

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
  contents: read
  pages: write
  id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
  group: "pages"
  cancel-in-progress: false

jobs:
  deploy:
    runs-on: ubuntu-latest
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    steps:
      - uses: actions/checkout@v4
      - name: setup pages
        uses: actions/configure-pages@v5
      - name: setup python
        uses: actions/setup-python@v5
        with:
          python-version: 3.x
      - name: setup cache
        run: |
          echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
      - name: handle cache
        uses: actions/cache@v4
        with:
          key: mkdocs-material-${{ env.cache_id }}
          path: .cache
          restore-keys: |
            mkdocs-material-
      - name: install mkdocs material
        run: |
          pip install mkdocs-material
      - name: run mkdocs material
        run: |
          mkdocs build
      - name: upload artifact
        uses: actions/upload-pages-artifact@v3
        with:
          # Upload entire repository
          path: public/
      - name: deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v4