This repository has been archived on 2024-05-03. You can view files and clone it, but cannot push or open issues or pull requests.
treefmt/.github/workflows/gh-pages.yml
Brian McGee 9cc0ab7b8c
ci: testing alternative gh pages workflow
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-03 18:05:57 +01:00

50 lines
1.3 KiB
YAML

# Build and deploy MkDocs to gh-pages for main branch
name: gh-pages
on:
push:
branches:
- main
- staging
- trying
pull_request:
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v25
- uses: cachix/cachix-action@v14
with:
name: numtide
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Build the docs
id: build
run: |
nix build .#docs
echo "result=$(readlink ./result)" >> $GITHUB_OUTPUT
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
if: github.ref == 'refs/heads/main'
with:
path: result
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4