Deploy Pages #1269
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 Pages | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| schedule: | |
| - cron: '0 */8 * * *' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Install poetry | |
| run: pipx install poetry | |
| - name: Checkout git repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| architecture: 'x64' | |
| cache: 'poetry' | |
| - name: Install Python dependencies | |
| run: poetry install -n | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| architecture: 'x64' | |
| cache: 'npm' | |
| - name: Install npm packages | |
| run: npm install --no-fund -f -g svgo html-minifier-terser postcss cssnano postcss-svgo postcss-cli uglify-js | |
| - name: Install additional Ubuntu packages | |
| uses: awalsh128/cache-apt-pkgs-action@latest | |
| with: | |
| packages: rustc pngquant libjpeg-turbo-progs | |
| version: 'ubuntu' | |
| - name: Install oxipng | |
| uses: baptiste0928/cargo-install@v2 | |
| with: | |
| crate: oxipng | |
| - name: Restore MkDocs cached files | |
| uses: actions/cache@v3 | |
| with: | |
| path: .pub_min_cache | |
| key: mkdocs-publisher-cache-${{ github.run_id }} | |
| restore-keys: mkdocs-publisher-cache- | |
| - name: Build mkdocs-publisher documentation | |
| run: poetry run mkdocs build -c | |
| - name: Store documentation build and debug logs as artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: docs-build-logs | |
| if-no-files-found: ignore | |
| retention-days: 3 | |
| path: | | |
| *_mkdocs_build.log | |
| *_mkdocs_debug.zip | |
| - name: Upload static files as artifact | |
| id: deployment | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs/ | |
| - name: Save MkDocs files cache | |
| uses: actions/cache/save@v3 | |
| with: | |
| path: .pub_min_cache | |
| key: mkdocs-publisher-cache-${{ github.run_id }} | |
| deploy: | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |