Merge pull request #65 from andrewhowdencom/add-listen-address #59
This file contains 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: "build:documentation" | |
on: | |
push: | |
branches: ["main"] | |
jobs: | |
# Build the docs | |
build: | |
permissions: | |
# Needed to cancel the build | |
actions: write | |
# The machine type on which the workload is running | |
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#choosing-github-hosted-runners | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout the main branch | |
uses: actions/checkout@v4 | |
- uses: dorny/paths-filter@v2.2.1 | |
id: filter | |
with: | |
filters: | | |
docs: | |
- docs/** | |
- name: "(Optionally) Cancel the build" | |
if: ${{ steps.filter.outputs.docs == 'false' }} | |
# Wait required, as this pauses the build until its cancelled. | |
run: | | |
gh run cancel ${{ github.run_id }} | |
gh run watch ${{ github.run_id }} | |
env: | |
GH_TOKEN: ${{ github.token }} | |
# Setup Python (& Dependencies) | |
- name: "Setup Python" | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
- name: "Install poetry" | |
run: pipx install poetry | |
# Install the Task Runner | |
- name: Install Task | |
uses: arduino/setup-task@v1 | |
# Generate the documentation | |
- name: "Build the documentation artifact" | |
run: task docs/tar | |
# Upload it | |
- name: "Upload Artifact" | |
uses: actions/upload-artifact@v4 | |
with: | |
name: docs+${{ github.sha }} | |
path: "dist/docs.tar.gz" | |
retention-days: 1 | |
if-no-files-found: error | |
# Deploy the compiled docs | |
deploy: | |
needs: build | |
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
# See https://github.com/actions/deploy-pages | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: "Deploy to GitHub pages" | |
uses: actions/deploy-pages@v4 | |
with: | |
artifact_name: docs+${{ github.sha }} |