Skip to content

Commit

Permalink
Fix documentation workflow conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
phavekes committed Oct 4, 2023
1 parent 52fb6ab commit 6cb2539
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
java-version: '17'
distribution: 'adopt'
cache: 'maven'
if: steps.changes.outputs.archi == 'true'
if: steps.changes.outputs.server == 'true'

- name: Set up MySQL
uses: shogo82148/actions-setup-mysql@v1
Expand All @@ -63,31 +63,31 @@ jobs:
"CREATE USER 'access'@'localhost' IDENTIFIED BY 'secret';";
mysql -uroot -h127.0.0.1 -e \
"GRANT ALL privileges ON access.* TO 'access'@'localhost';"
if: steps.changes.outputs.archi == 'true'
if: steps.changes.outputs.server == 'true'

- name: Generate openapi.json
run: mvn verify -DskipTests=true
if: steps.changes.outputs.archi == 'true'
if: steps.changes.outputs.server == 'true'

- name: Test api-specs with redoc-cli
uses: seeebiii/redoc-cli-github-action@v10
with:
args: 'bundle server/target/openapi.json -t template.hbs -o docs/api/index.html'
if: steps.changes.outputs.archi == 'true'
if: steps.changes.outputs.server == 'true'

- name: check result
run: |
ls -al docs/api/
test -f docs/api/index.html || (echo "Missing docs/api/index.html from previous step." && exit 1)
if: steps.changes.outputs.archi == 'true'
if: steps.changes.outputs.server == 'true'

- name: Commit files if the OpenAPI html has changed
run: |
git config user.name github-actions
git config user.email [email protected]
git add docs/api/index.html
git diff-index --quiet HEAD || git commit -m "Update github page"
if: steps.changes.outputs.archi == 'true'
if: steps.changes.outputs.server == 'true'
continue-on-error: true

# Generate a HTML page for the archmate model, only if the moder has changed
Expand Down

0 comments on commit 6cb2539

Please sign in to comment.