diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9cb2301..1b6e04e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,7 +11,6 @@ jobs: name: C++ - ${{ github.event_name }} runs-on: ubuntu-latest permissions: - actions: write contents: read steps: - uses: actions/checkout@v4 @@ -19,35 +18,38 @@ jobs: - run: cmake --build build --parallel - run: ctest --test-dir build --output-on-failure --verbose --no-compress-output - docs: - name: Generate and Deploy Docs + build-docs: + name: Build Documentation runs-on: ubuntu-latest - permissions: - contents: read - pages: write - id-token: write - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} steps: - uses: actions/checkout@v4 - name: Install Doxygen run: sudo apt-get update && sudo apt-get install -y doxygen - # Runs on every push and PR to verify Doxygen doesn't crash + # Runs on every push/PR to verify Doxygen doesn't crash - name: Generate Documentation run: doxygen Doxyfile - # Only upload the artifact if merging into main + # Packages the HTML into a zip file for the next job - name: Upload GitHub Pages Artifact - if: github.ref == 'refs/heads/main' uses: actions/upload-pages-artifact@v3 with: path: './docs/html' - - # Only deploy the site if merging into main + + deploy-docs: + name: Deploy to GitHub Pages + needs: build-docs + runs-on: ubuntu-latest + # This prevents the job (and the environment) from running on PRs/branches + if: github.ref == 'refs/heads/main' + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: - name: Deploy to GitHub Pages - if: github.ref == 'refs/heads/main' id: deployment uses: actions/deploy-pages@v4 \ No newline at end of file