From 85492e587cc27ba9783c8380683660a0f4423ff4 Mon Sep 17 00:00:00 2001 From: Gokul Soumya Date: Mon, 14 Mar 2022 08:16:40 +0530 Subject: Deploy docs for master separately (#1783) * Deploy docs for master separately * Output docs for every tagged release * Update .github/workflows/gh-pages.yml Co-authored-by: Blaž Hrastnik --- .github/workflows/gh-pages.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to '.github/workflows/gh-pages.yml') diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index bf3488c8..223f8450 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -4,6 +4,8 @@ on: push: branches: - master + tags: + - '*' jobs: deploy: @@ -18,10 +20,22 @@ jobs: # mdbook-version: '0.4.8' - run: mdbook build book + + - name: Set output directory + run: | + OUTDIR=$(basename ${{ github.ref }}) + echo "OUTDIR=$OUTDIR" >> $GITHUB_ENV - name: Deploy uses: peaceiris/actions-gh-pages@v3 - if: github.ref == 'refs/heads/master' + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./book/book + destination_dir: ./${{ env.OUTDIR }} + + - name: Deploy stable + uses: peaceiris/actions-gh-pages@v3 + if: startswith(github.ref, 'refs/tags/') with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./book/book -- cgit v1.2.3-70-g09d2