crane/.github/workflows/pages.yml
dependabot[bot] 88dc927720
chore(deps): bump cachix/install-nix-action from 18 to 20 (#257)
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 18 to 20.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v18...v20)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-01 16:47:19 -08:00

42 lines
1.1 KiB
YAML

name: "pages"
on:
push:
branches:
- "master"
permissions:
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
- uses: cachix/cachix-action@v12
with:
name: crane
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: mdbook build
run: |
mkdir output
nix build .#book --out-link result --print-build-logs
rsync -r -L ./result/ ./output
- name: git commit
working-directory: output
run: |
git init
git config user.name "GitHub Actions"
git config user.email "github-actions-bot@users.noreply.github.com"
git branch -M gh-pages
git add .
git commit -m "Deploying site"
- name: git push
working-directory: output
run: |
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add - <<< "${{ secrets.DEPLOY_KEY }}"
git push --force "git@github.com:${GITHUB_REPOSITORY}.git" gh-pages