From 8152167218652790a69a1f05aa48a89780c402ac Mon Sep 17 00:00:00 2001 From: Alex Parsons Date: Fri, 9 Feb 2024 09:22:38 +0000 Subject: [PATCH] Seperate out phpdoc to docker based action --- .github/workflows/default.yml | 8 +----- .github/workflows/docs.yml | 50 +++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/default.yml b/.github/workflows/default.yml index 9bfca729cc..560483c2fe 100644 --- a/.github/workflows/default.yml +++ b/.github/workflows/default.yml @@ -102,10 +102,4 @@ jobs: if: matrix.php_version == '7.4' run: | wget https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml - - - name: Documentation - if: matrix.php_version == '7.4' && github.ref_name == 'master' && github.event_name == 'push' - run: | - sudo apt-get update && sudo apt-get install -y graphviz - ./build-docs.sh + php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml \ No newline at end of file diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000000..0f734700e5 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,50 @@ +name: Generate docs + +permissions: + contents: write + pages: write + id-token: write + +on: + push: + branches: ["main"] + workflow_dispatch: + +jobs: + docs: + name: Generate documentation + runs-on: ubuntu-latest + + steps: + + - uses: actions/checkout@v4 + with: + submodules: true + + - name: Run phpdoc + run: | + docker run --rm -v $(pwd):/data phpdoc/phpdoc:3 -t ./docs + + - name: Setup Pages + uses: actions/configure-pages@v4 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: docs + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + runs-on: ubuntu-latest + needs: docs + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 + + - uses: geekyeggo/delete-artifact@v2 + with: + name: github-pages \ No newline at end of file