diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..4553e686 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,75 @@ +name: Docs + +"on": + pull_request: + push: + branches: + - main + workflow_dispatch: + +permissions: + contents: read + +jobs: + validate: + name: Validate documentation + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v7 + + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: "3.12" + cache: pip + cache-dependency-path: requirements-docs.txt + + - name: Check Dev Notes renderer syntax + run: python -m py_compile scripts/render-dev-notes.py + + - name: Build documentation + run: scripts/build-docs.sh + + deploy: + name: Deploy documentation + if: >- + github.ref == 'refs/heads/main' && + (github.event_name == 'push' || github.event_name == 'workflow_dispatch') + needs: validate + runs-on: ubuntu-latest + permissions: + contents: read + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + concurrency: + group: github-pages + cancel-in-progress: false + steps: + - name: Checkout + uses: actions/checkout@v7 + + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: "3.12" + cache: pip + cache-dependency-path: requirements-docs.txt + + - name: Configure GitHub Pages + uses: actions/configure-pages@v6 + + - name: Build documentation + run: scripts/build-docs.sh + + - name: Upload Pages artifact + uses: actions/upload-pages-artifact@v5 + with: + path: site + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v5 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 0362c075..00000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,15 +0,0 @@ -image: python:3.12-slim - -pages: - tags: - - os/linux-arm - - type/docker - script: - - scripts/build-docs.sh - - rm -rf public - - mv site public - artifacts: - paths: - - public - only: - - main diff --git a/README.md b/README.md index 1ef43ce5..02fadc82 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,8 @@ OpenShell as the runtime. navigation entries from post front matter. - `zensical.toml` configures the documentation site. - `requirements-docs.txt` pins the documentation build toolchain. -- `.gitlab-ci.yml` builds the documentation site in GitLab CI. +- `.github/workflows/docs.yml` validates documentation builds in GitHub Actions + and deploys the generated site to GitHub Pages. ## Documentation workflow