Update termination.md (#21) #76
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: Generate tutorial | |
| on: [push, pull_request] | |
| jobs: | |
| generate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout tutorial | |
| uses: actions/checkout@v2 | |
| with: | |
| path: "tutorial" | |
| - name: Checkout build branch | |
| uses: actions/checkout@v2 | |
| with: | |
| ref: "build" | |
| path: "tutorial-build" | |
| - name: Setup mdBook | |
| uses: peaceiris/actions-mdbook@v1 | |
| with: | |
| mdbook-version: "latest" | |
| - name: Generate tutorial | |
| run: | | |
| cd tutorial | |
| mdbook build | |
| - name: Create build commit | |
| if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' | |
| run: | | |
| cd tutorial-build | |
| git rm -r * | |
| rm -rf * | |
| git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git config --local user.name "github-actions[bot]" | |
| cp -r ../tutorial/book/* . | |
| git add * | |
| git commit -m "Deploy $(date +'%Y-%m-%d %H:%M:%S')" | |
| - name: Push tutorial to build branch | |
| if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' | |
| uses: ad-m/github-push-action@master | |
| with: | |
| branch: build | |
| force: true | |
| directory: tutorial-build |