From f3a72824103a5d5729640d06c122d1535f621325 Mon Sep 17 00:00:00 2001 From: Malo Bourgon Date: Mon, 21 Mar 2022 13:39:41 -0700 Subject: [PATCH] Add workflow to auto-update manual --- .github/workflows/update-manual.yml | 39 +++++++++++++++++++++++++++++ .gitignore | 1 + 2 files changed, 40 insertions(+) create mode 100644 .github/workflows/update-manual.yml diff --git a/.github/workflows/update-manual.yml b/.github/workflows/update-manual.yml new file mode 100644 index 00000000..c9b70b16 --- /dev/null +++ b/.github/workflows/update-manual.yml @@ -0,0 +1,39 @@ +name: Update manual +on: + push: + branches: + - master + paths: + - '**.nix' + +jobs: + update-manual: + runs-on: macos-10.15 + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + # So that we fetch all branches, since we need to checkout the `gh-pages` branch later. + fetch-depth: 0 + + - name: Install Nix + uses: cachix/install-nix-action@v16 + with: + extra_nix_config: | + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} + + - name: Build manual + run: | + nix-build ./release.nix -I nixpkgs=channel:nixpkgs-21.11-darwin -I darwin=. -A manualHTML + + - name: Push update to manual + run: | + git checkout gh-pages + rm -rf manual + cp -R result/share/doc/darwin manual + rm result + git config user.name github-actions + git config user.email github-actions@github.com + git add --all + git commit -m "Update manual" + git push diff --git a/.gitignore b/.gitignore index 1377554e..5645a14e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.swp +result*