Skip to content

Commit

Permalink
phpDocumentor github action
Browse files Browse the repository at this point in the history
  • Loading branch information
jaapio committed Jan 31, 2020
1 parent c34e83f commit 6bb2063
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
@@ -1,6 +1,7 @@
.*
bin/*
!bin/phpdoc
!bin/githubaction
!bin/console
!bin/plantuml
build
Expand All @@ -9,6 +10,7 @@ features
tests
tools
var
vendor

*.md
behat.yml
Expand Down
25 changes: 17 additions & 8 deletions .github/workflows/docs.yml
@@ -1,15 +1,24 @@
on: [push]
name: Docs & Demo
jobs:
docs:
# docs:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@master
# - name: Build
# uses: elgohr/Publish-Docker-Github-Action@master
# with:
# name: phpdocumentor/phpdocumentor/docs.phpdoc.org
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
# registry: docker.pkg.github.com
# context: docs
demo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@master
- uses: ./ # use this repo as an action
with:
name: phpdocumentor/phpdocumentor/docs.phpdoc.org
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: docker.pkg.github.com
context: docs
template: 'clean'
config: 'data/examples/MariosPizzeria/phpdoc.xml'
target: 'build/clean'
2 changes: 2 additions & 0 deletions Dockerfile
Expand Up @@ -24,3 +24,5 @@ RUN cd /opt/phpdoc \
&& echo "memory_limit=-1" >> /usr/local/etc/php/conf.d/phpdoc.ini

ENTRYPOINT ["/opt/phpdoc/bin/phpdoc"]

CMD ["help", "run"]
18 changes: 18 additions & 0 deletions action.yml
@@ -0,0 +1,18 @@
name: 'phpDocumentor'
description: 'Builds a static webpage from your docblocks'
inputs:
template:
description: 'template to use'
required: false
default: 'default'
config:
description: 'path to config'
required: false
target:
description: 'target path'
required: false

runs:
using: 'docker'
image: 'Dockerfile'
entrypoint: '/opt/phpdoc/bin/githubaction'
16 changes: 16 additions & 0 deletions bin/githubaction
@@ -0,0 +1,16 @@
#!/usr/bin/env php
<?php

set_time_limit(0);

$arguments = array_filter([
'template' => getenv('INPUT_TEMPLATE'),
'config' => getenv('INPUT_CONFIG'),
'target' => getenv('INPUT_TARGET'),
]);

foreach ($arguments as $flag => $value) {
$_SERVER['argv'][] = sprintf('--%s=%s', $flag, $value);
}

require_once __DIR__.'/phpdoc';

0 comments on commit 6bb2063

Please sign in to comment.