Skip to content

Commit

Permalink
Add basic files
Browse files Browse the repository at this point in the history
  • Loading branch information
williamdes committed Dec 11, 2020
1 parent 901fafb commit f3b6717
Show file tree
Hide file tree
Showing 9 changed files with 105 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.git
/.github
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*]
indent_style = space
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
12 changes: 12 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Build docker image

on: [push]

jobs:
build-action:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Build action image
run: docker build ./
13 changes: 13 additions & 0 deletions .github/workflows/doctum.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: build doctum docs
on: [push]

jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: build doctum docs
uses: sudo-bot/action-doctum@v5
with:
config-file: doctum.php
method: "update"
cli-args: "--output-format=github --no-ansi --no-progress"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.env
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM php:cli-alpine

ARG RELEASE_VERSION=latest

COPY entrypoint.sh /entrypoint.sh

ADD https://doctum.long-term.support/releases/${RELEASE_VERSION}/doctum.phar /bin/doctum

RUN echo "Downloaded release version: ${RELEASE_VERSION}" && chmod +x /bin/doctum && php /bin/doctum --version

ENTRYPOINT ["/entrypoint.sh"]
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,15 @@

[Doctum](https://github.com/code-lts/doctum#readme)

## Example usage

```yml
- name: build doctum docs
uses: sudo-bot/action-doctum@v5
with:
config-file: doctum.php
# parse, render or update
method: "update"
# You can change them, defaults to '--output-format=github --no-ansi --no-progress' (optional)
cli-args: "--output-format=github --no-ansi --no-progress"
```
29 changes: 29 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "Use Doctum"
author: williamdes
description: "Use Doctum without having to install it"
inputs:
config-file:
description: "The configuration file"
required: true
method:
description: "parse, render or update"
required: true
cli-args:
description: "Command line arguments"
default: '--output-format=github --no-ansi --no-progress'
required: false
docker-version:
description: "The docker image to use"
default: 'latest'
required: false

branding:
icon: "book"
color: blue
runs:
using: "docker"
image: "docker://botsudo/action-doctum:${{ inputs.docker-version }}"
args:
- "${{ inputs.config-file }}"
- "${{ inputs.method }}"
- "${{ inputs.cli-args }}"
17 changes: 17 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh -l
##
# @license http://unlicense.org/UNLICENSE The UNLICENSE
# @author William Desportes <[email protected]>
##

set -e

CONFIG_FILE="$1"
METHOD="$2"
CLI_ARGS="$3"

echo "::debug CONFIG_FILE: ${CONFIG_FILE}"
echo "::debug METHOD: ${METHOD}"
echo "::debug CLI_ARGS: ${CLI_ARGS}"

php /bin/doctum ${METHOD} ${CLI_ARGS} ${CONFIG_FILE}

0 comments on commit f3b6717

Please sign in to comment.