[Fixes #1847] Building docs with GitHub Actions (#1855)

* Try building docs with GitHub Actions

* fix GH_PAT secret
This commit is contained in:
freezy 2019-10-02 11:09:22 +02:00 committed by Marcus Bointon
parent 26bd96350b
commit c1fbe8fe50
3 changed files with 53 additions and 0 deletions

15
.github/actions/build-docs/Dockerfile vendored Normal file
View File

@ -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"]

5
.github/actions/build-docs/entrypoint.sh vendored Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
set -eu
/opt/phpdoc/bin/phpdoc

33
.github/workflows/docs.yaml vendored Normal file
View File

@ -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 }}