Deploy Pelican site to GH Pages #14
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
| ## Workflow for building the site and (optionally) publishing it to GitHub | ||
| ## Pages. | ||
| ## The contents of this file were based on the existing deployment templates in | ||
| ## https://github.com/actions/starter-workflows/tree/main/pages | ||
| ## as well as the official Pelican docs at | ||
| ## https://github.com/getpelican/pelican/blob/main/.github/workflows/github_pages.yml | ||
| name: Deploy Pelican site to GH Pages | ||
| on: | ||
| push: | ||
| branches: [$default-branch] | ||
| workflow_dispatch: | ||
| jobs: | ||
| deploy: | ||
| uses: "getpelican/pelican/.github/workflows/github_pages.yml@main" | ||
| defaults: | ||
| run: | ||
| shell: bash | ||
| working-directory: "./src" | ||
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
| permissions: | ||
| contents: read | ||
| pages: write | ||
| id-token: write | ||
| with: | ||
| settings: "publishconf.py" | ||
| python: "3.9" | ||
| # FIXME: remove when workflow is no longer bitrotted | ||
| deploy: false | ||
| # Allow one concurrent deployment | ||
| concurrency: | ||
| group: "pages" | ||
| cancel-in-progress: true | ||
| ### defaults: | ||
| ### run: | ||
| ### shell: bash | ||
| ### | ||
| ### jobs: | ||
| ### build: | ||
| ### runs-on: ubuntu-latest | ||
| ### | ||
| ### steps: | ||
| ### - name: Checkout source | ||
| ### uses: actions/checkout@v3 | ||
| ### | ||
| ### - name: Setup Python | ||
| ### uses: actions/setup-python@v4 | ||
| ### with: | ||
| ### python-version: "3.9" | ||
| ### cache: 'pip' | ||
| ### | ||
| ### - name: Install Pelican | ||
| ### run: pip install pelican markdown | ||
| ### | ||
| ### - name: Build site using Pelican | ||
| ### run: | | ||
| ### cd src | ||
| ### pelican content -s publishconf.py | ||
| ### cd .. | ||
| ### | ||
| ### - name: Upload site | ||
| ### uses: actions/upload-pages-artifact@v1 | ||
| ### with: | ||
| ### path: ./src/output | ||
| ### | ||
| ### deploy: | ||
| ### environment: | ||
| ### name: github-pages | ||
| ### url: ${{ steps.deployment.outputs.page_url }} | ||
| ### runs-on: ubuntu-latest | ||
| ### needs: build | ||
| ### steps: | ||
| ### - name: Deploy to GH Pages | ||
| ### id: deployment | ||
| ### uses: actions/deploy-pages@v1 | ||