Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,40 @@ jobs:
with:
path: docs/doxygen/html

check_pages:
name: Check GitHub Pages status
runs-on: ubuntu-latest
outputs:
enabled: ${{ steps.pages_status.outputs.enabled }}
steps:
- name: Check whether GitHub Pages is enabled
id: pages_status
uses: actions/github-script@v7
with:
script: |
try {
await github.rest.repos.getPages({
owner: context.repo.owner,
repo: context.repo.repo
});
core.setOutput('enabled', 'true');
core.info('GitHub Pages is enabled.');
} catch (error) {
if (error.status === 404) {
core.setOutput('enabled', 'false');
core.warning('GitHub Pages is not enabled for this repository; skipping deployment.');
} else {
throw error;
}
}

deploy:
name: Deploy to GitHub Pages
needs: build
needs: [build, check_pages]
if: needs.check_pages.outputs.enabled == 'true'
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy
id: deployment
Expand Down
Loading