1name: Deploy 2 3on: 4 push: 5 branches: 6 - master 7 paths: 8 - book/** 9 - .github/workflows/site.yml 10 workflow_dispatch: 11 12jobs: 13 deploy: 14 name: Deploy 15 runs-on: ubuntu-latest 16 permissions: 17 contents: write 18 timeout-minutes: 30 19 steps: 20 - uses: actions/checkout@v4 21 - uses: dtolnay/install@mdbook 22 - run: mdbook --version 23 24 - name: Build 25 run: book/build.sh 26 27 - name: Push to gh-pages 28 working-directory: book/build 29 run: | 30 REV=$(git rev-parse --short HEAD) 31 git init 32 git remote add upstream https://x-access-token:${{secrets.GITHUB_TOKEN}}@github.com/dtolnay/cxx 33 git config user.name "CXX" 34 git config user.email "dtolnay+cxx@gmail.com" 35 git add -A . 36 git commit -qm "Website @ ${{github.repository}}@${REV}" 37 git push -q upstream HEAD:refs/heads/gh-pages --force 38