Skip to content

Commit 43a57ff

Browse files
committed
Add workflow for deploying docs to GitHub Pages
1 parent a839f85 commit 43a57ff

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

.github/workflows/deploy-docs.yaml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# --------------------------------------------------------------------------------------------------------- #
2+
# Deploy docs workflow
3+
# --------------------------------------------------------------------------------------------------------- #
4+
5+
name: 'Deploy documentation'
6+
on:
7+
push:
8+
branches:
9+
- main
10+
11+
job:
12+
build-and-deploy:
13+
name: "Build docs. and deploy"
14+
runs-on: ubuntu-latest
15+
16+
# @see https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/control-the-concurrency-of-workflows-and-jobs
17+
concurrency: ci-${{ github.ref }}
18+
19+
steps:
20+
21+
# ------------------------------------------------------------------------------------------------------- #
22+
# Checkout code ...
23+
# ------------------------------------------------------------------------------------------------------- #
24+
25+
- name: "Checkout"
26+
uses: actions/checkout@v4
27+
28+
29+
# ------------------------------------------------------------------------------------------------------- #
30+
# Setup PHP
31+
# ------------------------------------------------------------------------------------------------------- #
32+
33+
- name: "Setup PHP"
34+
uses: shivammathur/setup-php@v2
35+
with:
36+
php-version: 8.2
37+
extensions: mbstring
38+
ini-values: error_reporting=E_ALL
39+
tools: composer:v2
40+
41+
# ------------------------------------------------------------------------------------------------------- #
42+
# Install dependencies
43+
# ------------------------------------------------------------------------------------------------------- #
44+
45+
- name: "Install dependencies"
46+
uses: nick-fields/retry@v3
47+
with:
48+
timeout_minutes: 5
49+
max_attempts: 2
50+
command: composer install --no-progress --prefer-dist --no-interaction --optimize-autoloader --ansi
51+
52+
# ------------------------------------------------------------------------------------------------------- #
53+
# Build documentation
54+
# ------------------------------------------------------------------------------------------------------- #
55+
56+
- name: "Build documentation"
57+
run: |
58+
composer run docs:build --ansi
59+
60+
# ------------------------------------------------------------------------------------------------------- #
61+
# Deploy to GitHub pages
62+
# ------------------------------------------------------------------------------------------------------- #
63+
64+
# @see https://github.com/JamesIves/github-pages-deploy-action
65+
- name: "Deploy"
66+
uses: JamesIves/github-pages-deploy-action@v4
67+
with:
68+
folder: build/docs
69+
branch: gh-pages

0 commit comments

Comments
 (0)