From c1ff6cd2ff273bd1ce2f637c73d939af942bba20 Mon Sep 17 00:00:00 2001 From: Kristaps Berzinch Date: Sun, 10 Mar 2024 18:33:37 -0400 Subject: [PATCH] Split out docs build to trigger only if docs are changed --- .github/workflows/build.yml | 42 +++------------------------------- .github/workflows/docs.yml | 45 +++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 39 deletions(-) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 044c3e47b..783051042 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 @@ -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: @@ -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: @@ -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: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 000000000..904259994 --- /dev/null +++ b/.github/workflows/docs.yml @@ -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 .