Przeglądaj źródła

:octocat: run phpdoc without extra action

codemasher 4 lat temu
rodzic
commit
0164234344

+ 0 - 17
.github/actions/build-docs/Dockerfile

@@ -1,17 +0,0 @@
-# https://hub.docker.com/r/phpdoc/phpdoc
-FROM phpdoc/phpdoc:3.0
-
-LABEL "repository"="https://github.com/chillerlan/php-qrcode"
-
-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
-RUN chmod +x /entrypoint.sh
-
-ENTRYPOINT ["/entrypoint.sh"]

+ 0 - 5
.github/actions/build-docs/entrypoint.sh

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

+ 0 - 30
.github/workflows/docs.yml

@@ -1,30 +0,0 @@
-# from https://github.com/PHPMailer/PHPMailer
-
-on:
-  push:
-    branches:
-      - main
-
-name: "Docs"
-
-jobs:
-  build_and_publish:
-    name: "Build and publish Docs"
-    runs-on: ubuntu-latest
-
-    steps:
-      - name: "Checkout sources"
-        uses: actions/checkout@v2
-        with:
-          fetch-depth: 1
-
-      - name: "Build Docs"
-        uses: ./.github/actions/build-docs
-
-      - name: "Publish Docs to gh-pages"
-        uses: JamesIves/github-pages-deploy-action@4.1.5
-        with:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-          BRANCH: gh-pages
-          FOLDER: .
-          CLEAN: true

+ 28 - 4
.github/workflows/tests.yml

@@ -36,6 +36,34 @@ jobs:
       - name: "Run phan"
         run: php vendor/bin/phan
 
+  build-docs:
+    name: "Build and publish Docs"
+
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: "Checkout sources"
+        uses: actions/checkout@v2
+
+      - name: "Install PHP"
+        uses: shivammathur/setup-php@v2
+        with:
+          php-version: "7.4"
+          coverage: none
+          tools: phpDocumentor:3
+          extensions: ast, gd, imagick, json, mbstring
+
+      - name: "Build Docs"
+        run: phpdoc --config=phpdoc.xml`
+
+      - name: "Publish Docs to gh-pages"
+        uses: JamesIves/github-pages-deploy-action@4.1.5
+        with:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+          BRANCH: gh-pages
+          FOLDER: docs
+          CLEAN: true
+
   tests:
     name: "Unit Tests"
 
@@ -53,10 +81,6 @@ jobs:
           - "8.1"
 
     steps:
-#      - name: "Configure git to avoid issues with line endings"
-#        if: matrix.os == 'windows-latest'
-#        run: git config --global core.autocrlf false
-
       - name: "Checkout"
         uses: actions/checkout@v2