diff --git a/.github/actions/build-docs/Dockerfile b/.github/actions/build-docs/Dockerfile new file mode 100644 index 00000000..404b94a5 --- /dev/null +++ b/.github/actions/build-docs/Dockerfile @@ -0,0 +1,15 @@ +FROM phpdoc/phpdoc + +LABEL "repository"="https://github.com/PHPMailer/PHPMailer" + +LABEL "com.github.actions.name"="Build Docs" +LABEL "com.github.actions.description"="Build Docs with phpDocumentor" +LABEL "com.github.actions.icon"="file-text" +LABEL "com.github.actions.color"="blue" + +# don't show errors +RUN echo "display_errors = Off" > $PHP_INI_DIR/conf.d/errors.ini + +COPY entrypoint.sh /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/.github/actions/build-docs/entrypoint.sh b/.github/actions/build-docs/entrypoint.sh new file mode 100755 index 00000000..0d7061a0 --- /dev/null +++ b/.github/actions/build-docs/entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +set -eu + +/opt/phpdoc/bin/phpdoc diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml new file mode 100644 index 00000000..6a2c6f89 --- /dev/null +++ b/.github/workflows/docs.yaml @@ -0,0 +1,33 @@ +name: Docs +on: push + +jobs: + build: + name: Build Docs + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v1 + with: + fetch-depth: 1 + - name: Build Docs + uses: ./.github/actions/build-docs + - name: Upload file artifacts + uses: actions/upload-artifact@v1 + with: + name: docs + path: docs/ + + publish: + name: Publish Docs + runs-on: ubuntu-latest + steps: + - name: Download file artifacts + uses: actions/download-artifact@v1 + with: + name: docs + - name: Publish Docs to gh-pages + uses: maxheld83/ghpages@v0.2.1 + env: + BUILD_DIR: docs/ + GH_PAT: ${{ secrets.GH_PAT }}