@@ -4,6 +4,8 @@ on:
44 push:
55 branches:
66 - master
7+ tags:
8+ - '*'
79
810jobs:
911 deploy:
@@ -18,10 +20,22 @@ jobs:
1820 # mdbook-version: '0.4.8'
1921
2022 - run: mdbook build book
23+
24+ - name: Set output directory
25+ run: |
26+ OUTDIR=$(basename ${{ github.ref }})
27+ echo "OUTDIR=$OUTDIR" >> $GITHUB_ENV
2128
2229 - name: Deploy
2330 uses: peaceiris/actions-gh-pages@v3
24− if: github.ref == 'refs/heads/master'
31+ with:
32+ github_token: ${{ secrets.GITHUB_TOKEN }}
33+ publish_dir: ./book/book
34+ destination_dir: ./${{ env.OUTDIR }}
35+
36+ - name: Deploy stable
37+ uses: peaceiris/actions-gh-pages@v3
38+ if: startswith(github.ref, 'refs/tags/')
2539 with:
2640 github_token: ${{ secrets.GITHUB_TOKEN }}
2741 publish_dir: ./book/book