Deploy to GitHub Pages
This guide publishes a site on GitHub Pages, with a workflow of GitHub Actions that builds it on each push to main. Turn on GitHub Pages for the repository first, with "GitHub Actions" as the source.
name: Docs
on:
push:
branches: [main]
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Get Flight Manual
run: |
curl -fsSL https://github.com/beetlebugorg/flight-manual/releases/download/v0.1.0/flight-manual-0.1.0-x86_64-linux.tar.gz | tar xz
echo "$PWD/flight-manual-0.1.0-x86_64-linux" >> "$GITHUB_PATH"
- run: flight-manual build -strict _site
- uses: actions/upload-pages-artifact@v3
with:
path: _site
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4
Pin each action to a commit, as the workflows of this repository do, and check the SHA-256 of the release with its file SHA256SUMS.
The key url of the site file is the URL of the site on GitHub Pages, such as https://NAME.github.io/REPO/. Each page has a canonical link to it, and sitemap.xml lists it. The links between the pages are relative, so the site works in each folder of a server.
The docs of Flight Manual are built and published this way by .github/workflows/docs.yml of this repository.
Next: Move from another generator.