-
Notifications
You must be signed in to change notification settings - Fork 0
144 lines (127 loc) · 5.55 KB
/
Copy pathgh-pages.yml
File metadata and controls
144 lines (127 loc) · 5.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
---
name: GitHub-Pages
on:
workflow_dispatch:
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onworkflow_dispatchinputs
inputs:
operating-system:
description: "OS name and version runtime"
required: false
default: "ubuntu-24.04"
type: string
php-version:
description: "PHP runtime version in format Major.minor"
required: false
default: "8.2"
type: string
php-extensions:
description: "PHP runtime extensions you want to add or disable"
default: ""
required: false
type: string
destination-dir:
description: "Path where to store documentation on gh-pages branch"
required: false
default: "2.5"
type: string
force-orphan:
description: "Allows you to make your publish branch with only the latest commit"
required: false
default: false
type: boolean
hook-script:
description: "Hook script to run custom project task before deploying documentation"
required: false
default: ""
type: string
composer-options:
description: "Composer options for ramsey/composer-install GitHub Action"
default: "--prefer-dist --no-scripts"
required: false
type: string
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
permissions:
contents: write
jobs:
deploy_to_pages:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ${{ inputs.operating-system }}
php:
- ${{ inputs.php-version }}
extensions:
- ${{ inputs.php-extensions }}
steps:
- # https://github.com/actions/checkout
name: Checkout Code
uses: actions/checkout@v6.0.3
with:
# Make sure the value of GITHUB_TOKEN will not be persisted in repo's config
persist-credentials: false
# uncomment if you want to retrieve all history for all branches and tags
# fetch-depth: 0
- # Setup Libraries
name: Setup Libraries
run: |
sudo apt-get update
sudo apt-get install graphviz -y
- # https://github.com/shivammathur/setup-php
name: Setup PHP runtime
uses: shivammathur/setup-php@2.37.1
with:
php-version: ${{ matrix.php }}
extensions: ${{ matrix.extensions }}
coverage: "none"
- # https://getcomposer.org/doc/06-config.md#platform
# https://github.com/bamarni/composer-bin-plugin?tab=readme-ov-file#forward-command-forward-command
name: Setup Composer Platform
run: |
composer config --json extra.bamarni-bin.forward-command true
- # https://github.com/ramsey/composer-install
name: Install Composer dependencies
uses: ramsey/composer-install@4.0.0
with:
dependency-versions: "highest"
composer-options: ${{ inputs.composer-options }}
env:
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}'
- # Hook to run custom project task before deploying documentation
name: Hook to run custom project task
if: endsWith(inputs.hook-script, '.sh')
shell: bash
run: |
"${GITHUB_WORKSPACE}/${{ inputs.hook-script }}"
- # https://github.com/actions/setup-python
name: Set up Python runtime
uses: actions/setup-python@v6.2.0
with:
python-version: 3.x
- # https://github.com/squidfunk/mkdocs-material
name: Install Material for MkDocs
run: pip install mkdocs-material
- # https://github.com/oprypin/markdown-callouts
name: Install Markdown Callouts
run: pip install markdown-callouts
- # https://github.com/pa-decarvalho/mkdocs-asciinema-player
# https://github.com/asciinema/asciinema-player
name: Install Mkdocs asciinema player
run: pip install mkdocs-asciinema-player
- # https://github.com/squidfunk/mkdocs-material
name: Build Docs
run: mkdocs build
- # https://github.com/peaceiris/actions-gh-pages
name: Deploy Docs
uses: peaceiris/actions-gh-pages@v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site
destination_dir: ${{ inputs.destination-dir }}
full_commit_message: "Deployed ${{ github.sha }} with MkDocs"
force_orphan: ${{ inputs.force-orphan }}
user_name: 'github-actions'
user_email: 'github-actions@users.noreply.github.com'