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 aa75d3db4e
feat: add initial github workflow
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-03 13:42:21 +01:00

38 lines
1019 B
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
jobs:
gh-pages:
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: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: "${{ steps.build.outputs.result }}/"