Merge pull request #60 from orbinson/feature/fix-pages #51
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: Publish Docs | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 1 * *' | |
push: | |
branches: | |
- 'main' | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- name: Cache local Maven repository | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Generate site | |
run: mvn --batch-mode --activate-profiles release --projects api,bundle install site | |
- name: Setup Pages | |
uses: actions/configure-pages@v2 | |
- name: Archive artifact | |
shell: sh | |
if: runner.os == 'Linux' | |
run: | | |
chmod -c -R +rX "$INPUT_PATH" | while read line; do | |
echo "::warning title=Invalid file permissions automatically fixed::$line" | |
done | |
tar \ | |
--dereference --hard-dereference \ | |
--directory "./api/target/gapidocs" \ | |
-cvf "$RUNNER_TEMP/artifact.tar" \ | |
. | |
tar \ | |
--dereference --hard-dereference \ | |
--directory "./bundle/target/gapidocs" \ | |
-cvf "$RUNNER_TEMP/artifact.tar" \ | |
. | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: github-pages | |
path: ${{ runner.temp }}/artifact.tar | |
retention-days: 90 | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |