diff --git a/.github/workflows/basic-tests.yml b/.github/workflows/basic-tests.yml index 523d1fe3cfb..b8bcad3bf3a 100644 --- a/.github/workflows/basic-tests.yml +++ b/.github/workflows/basic-tests.yml @@ -58,7 +58,8 @@ jobs: deploy_documentation: runs-on: ubuntu-latest needs: build - if: github.ref == 'refs/heads/master' && github.event_name == 'push' + if: github.ref == 'refs/heads/master' && (github.event_name == 'push' || github.event_name == 'release') + if: [ github.event_name == 'release']; then page=${GITHUB_REF#refs/tags/}; else page=current; fi steps: - name: retrieve built documentation uses: actions/download-artifact@v2 @@ -66,29 +67,9 @@ jobs: name: documentation-page - name: debug run: | - mkdir _gh-pages - mv latest _gh-pages - - name: deploying to gh-pages - uses: JamesIves/github-pages-deploy-action@3.7.1 - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - BRANCH: gh-pages - FOLDER: _gh-pages - SINGLE_COMMIT: true - deploy_documentation_release: - runs-on: ubuntu-latest - needs: build - if: github.ref == 'refs/head/master' && github.event_name == 'release' - steps: - - name: retrieve built documentation - uses: actions/download-artifact@v2 - with: - name: documentation-page - - name: debug - run: | - mkdir _gh-pages - mv latest _gh-pages/${GITHUB_REF#refs/tags/} - - name: deploying tag ${GITHUB_REF#refs/tags/} to gh-pages + mkdir _gh-pages/$page + mv latest _gh-pages/$page + - name: deploying $page to gh-pages uses: JamesIves/github-pages-deploy-action@3.7.1 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}