Skip to content

Commit

Permalink
De-duplicate code
Browse files Browse the repository at this point in the history
  • Loading branch information
GarethCabournDavies committed Jul 23, 2024
1 parent d8d7050 commit ee9c130
Showing 1 changed file with 5 additions and 24 deletions.
29 changes: 5 additions & 24 deletions .github/workflows/basic-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,37 +58,18 @@ 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
with:
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 }}
Expand Down

0 comments on commit ee9c130

Please sign in to comment.