Fix workflow #47
This file contains 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: 📖 Test Documentation | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
- docs | |
- tim-nix | |
# Paths can be used to only trigger actions when you have edited certain files, such as a file within the /docs directory | |
paths: | |
- ".github/workflows/nix-build.yml" | |
- "docs/**" | |
# Allow manually running in the actions tab | |
workflow_dispatch: | |
jobs: | |
# Runs when we create or update a PR | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: cachix/install-nix-action@v20 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
- uses: DeterminateSystems/magic-nix-cache-action@v2 | |
- run: nix-shell --run "./english_build.sh" | |
- run: | | |
mkdir /tmp/site | |
mv ./docs/output/html/en /tmp/site/en | |
cp -r deployment /tmp/site | |
cd /tmp/site | |
git init . | |
git add --all | |
git config --local user.email "[email protected]" | |
git config --local user.name "Test" | |
git commit -a -m "Update docs" | |
- uses: ad-m/github-push-action@master | |
with: | |
# Token for the repo | |
# Can be passed in using $\{{ secrets.GITHUB_TOKEN }} | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
# Destination branch to push changes | |
branch: gh-pages | |
# Use force push to fully overwrite the destination branch | |
force: true | |
# We have to push from the folder where files were generated. | |
# Same were the new repo was initialized in the previous step | |
directory: /tmp/site | |