Skip to content

Commit

Permalink
Split out docs build to trigger only if docs are changed
Browse files Browse the repository at this point in the history
  • Loading branch information
kberzinch committed Mar 10, 2024
1 parent 4053e50 commit c1ff6cd
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 39 deletions.
42 changes: 3 additions & 39 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,42 +107,6 @@ jobs:
- name: Run tests
run: php artisan test

docs:
name: Docs
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs/
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Setup Poetry
uses: abatilo/actions-poetry@v2

- name: Cache the virtualenv
uses: actions/cache@v4
with:
path: ~/.cache/pypoetry
key: venv-${{ hashFiles('poetry.lock') }}

- name: Install Poetry dependencies
run: poetry install

- name: Build Sphinx docs
run: poetry run sphinx-build -M dirhtml . _build

- name: Install and run Vale
run: |
poetry add vale
poetry run vale sync
poetry run vale .
docker:
name: Docker
runs-on: ubuntu-latest
Expand Down Expand Up @@ -179,7 +143,7 @@ jobs:

deploy-test:
name: Deploy
needs: [lint, test, docs, docker]
needs: [lint, test, docker]
uses: ./.github/workflows/deploy.yml
if: ${{ github.ref == 'refs/heads/main' }}
concurrency:
Expand All @@ -195,7 +159,7 @@ jobs:

deploy-sandbox:
name: Deploy
needs: [lint, test, docs, docker, deploy-test]
needs: [deploy-test]
uses: ./.github/workflows/deploy.yml
if: ${{ github.ref == 'refs/heads/main' }}
concurrency:
Expand All @@ -211,7 +175,7 @@ jobs:

deploy-production:
name: Deploy
needs: [lint, test, docs, docker, deploy-test, deploy-sandbox]
needs: [deploy-sandbox]
uses: ./.github/workflows/deploy.yml
if: ${{ github.ref == 'refs/heads/main' }}
concurrency:
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Docs
on:
push:
paths:
- 'docs/'
pull_request:
paths:
- 'docs/'

jobs:
docs:
name: Build Docs
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs/
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Setup Poetry
uses: abatilo/actions-poetry@v2

- name: Cache the virtualenv
uses: actions/cache@v4
with:
path: ~/.cache/pypoetry
key: venv-${{ hashFiles('poetry.lock') }}

- name: Install Poetry dependencies
run: poetry install

- name: Build Sphinx docs
run: poetry run sphinx-build -M dirhtml . _build

- name: Install and run Vale
run: |
poetry add vale
poetry run vale sync
poetry run vale .

0 comments on commit c1ff6cd

Please sign in to comment.