Skip to content

Commit

Permalink
Update book deploy CI to separete latest and tags. (FuelLabs#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
adlerjohn authored May 18, 2021
1 parent 0e88df6 commit 452b3a8
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches:
- master
tags:
- v*

jobs:
deploy:
Expand All @@ -18,8 +20,24 @@ jobs:

- run: mdbook build docs

- name: Deploy
- name: Deploy latest
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/book
destination_dir: latest
if: github.ref == 'refs/heads/master'

- name: Get tag
id: branch_name
run: |
echo ::set-output name=BRANCH_NAME::${GITHUB_REF#refs/tags/}
if: startsWith(github.ref, 'refs/tags')

- name: Deploy tag
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/book
destination_dir: ${{ steps.branch_name.outputs.BRANCH_NAME }}
if: startsWith(github.ref, 'refs/tags')

0 comments on commit 452b3a8

Please sign in to comment.