-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Shared setup action between workflows - doc action uses new github pages approach
- Loading branch information
Showing
3 changed files
with
96 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: 'Setup TWFY' | ||
description: | | ||
Common setup actions to share between workflows | ||
Still relies on the different services being defined in the original action. | ||
inputs: | ||
php_version: | ||
description: "Path to action being checked." | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
|
||
- uses: niden/actions-memcached@v7 | ||
|
||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ inputs.php_version }} | ||
extensions: memcached | ||
|
||
- name: Get Composer Cache Directory | ||
id: composer-cache | ||
shell: bash | ||
run: echo "dir=$(php composer.phar config cache-files-dir)" >> $GITHUB_OUTPUT | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-php-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: ${{ runner.os }}-php-composer- | ||
|
||
- name: Set up database and code | ||
shell: bash | ||
run: | | ||
php composer.phar install --no-interaction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Generate docs | ||
|
||
permissions: | ||
contents: write | ||
pages: write | ||
id-token: write | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
docs: | ||
name: Generate documentation | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: | ||
uses: ./.github/actions/setup-twfy | ||
with: | ||
php_version: "7.4" | ||
|
||
- name: Build documentation | ||
run: | | ||
sudo apt-get update && sudo apt-get install -y graphviz | ||
rm -rf docs || exit 0 | ||
mkdir docs | ||
./vendor/bin/phpdoc | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v3 | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v2 | ||
with: | ||
path: docs | ||
|
||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
needs: docs | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v2 | ||
|
||
- uses: geekyeggo/delete-artifact@v2 | ||
with: | ||
name: github-pages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters