Fix tests on some environments #554
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Documentation deployment | |
on: [ push ] | |
jobs: | |
deploy: | |
if: startsWith(github.repository, 'nbbrd/') && ((github.ref == 'refs/heads/develop') || startsWith(github.ref, 'refs/tags/v')) | |
name: Deploy to GitHub Pages | |
runs-on: ubuntu-latest | |
env: | |
DOC_SLUG: ${{ github.ref_name }} | |
DOC_URL: "https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/docs/${{ github.ref_name }}" | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
cache: 'maven' | |
- name: Setup docs with Maven | |
run: mvn -B -ntp install -DskipTests -P setup-docs | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: 'latest' | |
- name: Build pages | |
run: | | |
hugo --source docs -b ${{ env.DOC_URL }} | |
touch ./docs/public/.nojekyll | |
- name: Deploy pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./docs/public | |
destination_dir: ./docs/${{ env.DOC_SLUG }} | |
- name: Create summary | |
run: echo "Documentation available at ${{ env.DOC_URL }}" >> $GITHUB_STEP_SUMMARY | |
index-dir: | |
needs: deploy | |
name: Index GitHub Pages directory | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout pages | |
uses: actions/checkout@v3 | |
with: | |
ref: 'gh-pages' | |
- uses: actions/cache@v3 | |
with: | |
path: /root/.jbang | |
key: $-jbang-$ | |
restore-keys: | | |
$-jbang- | |
- name: Create index.html | |
uses: jbangdev/jbang-action@main | |
with: | |
trust: https://gist.github.com/charphi/ | |
script: https://gist.github.com/charphi/f44a24eb35dbd61b9f1d7759f0e561bd | |
scriptargs: -T Documentation docs -o public/index.html -d | |
env: | |
JBANG_REPO: /root/.jbang/repository | |
- name: Deploy index.html | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
destination_dir: ./docs | |
keep_files: true |