Skip to content

Commit

Permalink
ci: dont build book if pages is not enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexAegis committed May 5, 2024
1 parent 8d4f628 commit a8bf38b
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,19 @@ jobs:
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
- name: check format and clippy
run: cargo make lint
check-pages:
runs-on: ubuntu-latest
outputs:
pages_enabled: ${{ steps.check_pages.outputs.is_enabled }}
steps:
- name: check if github pages is enabled
id: check_pages
uses: AlexAegis/check-pages-availability
mdbook:
runs-on: ubuntu-latest
needs: [test, lint]
needs: [test, lint, check-pages]
if: |
needs.check-pages.outputs.pages_enabled == 'true'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
Expand Down Expand Up @@ -94,9 +104,10 @@ jobs:
name: deploy github pages
if: |
github.ref_name == github.event.repository.default_branch &&
github.event_name != 'pull_request'
github.event_name != 'pull_request' &&
needs.check-pages.outputs.pages_enabled == 'true'
runs-on: ubuntu-latest
needs: [mdbook]
needs: [mdbook, check-pages]
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down

0 comments on commit a8bf38b

Please sign in to comment.