Skip to content

Commit

Permalink
Merge pull request #1197 from davidhewitt/update-doc-redirect
Browse files Browse the repository at this point in the history
Fix doc redirect on release
  • Loading branch information
davidhewitt committed Sep 16, 2020
2 parents c1b3e06 + 2213ab3 commit 88358de
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/guide.yml
Expand Up @@ -12,6 +12,8 @@ env:
jobs:
deploy:
runs-on: ubuntu-latest
outputs:
tag_name: ${{ steps.prepare_tag.outputs.tag_name }}
steps:
- uses: actions/checkout@v2

Expand Down Expand Up @@ -44,3 +46,22 @@ jobs:
publish_dir: ./gh-pages-build/
destination_dir: ${{ steps.prepare_tag.outputs.tag_name }}
full_commit_message: 'Upload documentation for ${{ steps.prepare_tag.outputs.tag_name }}'

release:
needs: deploy
if: ${{ env.GITHUB_EVENT_NAME == 'release' }}
steps:
- name: Create latest tag redirect
env:
TAG_NAME: ${{ needs.deploy.outputs.tag_name }}
run: |
mkdir public
echo "<meta http-equiv=refresh content=0;url='$TAG_NAME/'>" > public/index.html
- name: Deploy
uses: peaceiris/actions-gh-pages@v3.7.0-8
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public/
full_commit_message: 'Release ${{ steps.prepare_tag.outputs.tag_name }}'
keep_files: true

0 comments on commit 88358de

Please sign in to comment.