general FANTASY #30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: MdBook Build and Deploy | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
permissions: | |
contents: write | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install Nix package manager | |
uses: DeterminateSystems/nix-installer-action@main | |
- name: Build the book using Nix | |
run: | | |
nix build .#mdbookBuild | |
ls -la result | |
- name: Copy build result | |
run: | | |
mkdir -p build_output | |
cp -r result/* build_output | |
- name: Deploy build to gh-pages branch | |
uses: crazy-max/ghaction-github-pages@v4 | |
with: | |
target_branch: gh-pages | |
build_dir: build_output | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |