-
Notifications
You must be signed in to change notification settings - Fork 1
208 lines (165 loc) · 4.62 KB
/
pages-publish.yml
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
name: Publish Pages
on:
push:
branches: [dist]
permissions:
contents: write
env:
GITHUB_ACTIONS: true
jobs:
index:
name: Index
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: true
environment:
name: pages-build
url: ${{ steps.config.outputs.base_url }}
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
.github/pages/_config.yml
.github/favicon.ico
README.md
sparse-checkout-cone-mode: false
- name: Move pages config
run: |
mv .github/pages/_config.yml ./_config.yml
mv .github/favicon.ico ./favicon.ico
rm -rf ./.github
- name: Setup Pages
id: config
uses: actions/configure-pages@v3
with:
generator_config_file: ./_config.yml
- name: Build Pages
uses: actions/jekyll-build-pages@v1
- uses: actions/upload-artifact@v3
with:
name: pages-index-html
path: |
./_site
!./_site/**/*.md
coverage:
name: Coverage
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v3
- name: Setup PHP 8.2.9 with Xdebug
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
coverage: xdebug
tools: composer
- name: Restore Composer package cache
uses: actions/cache@v3
with:
path: |
~/.cache/composer/files
~/.cache/composer/vcs
key: "composer-v2-cache-8.2.9-${{ hashFiles('./composer.json') }}"
restore-keys: |
composer-v2-cache-
- name: Install Composer dependencies
run: composer install --prefer-dist --no-interaction
- name: Generate coverage html
run: composer coverage-ci
- name: Generate coverage badge
uses: timkrase/[email protected]
with:
report_type: html
report: .phpunit/coverage/index.html
coverage_badge_path: .phpunit/coverage/badge.svg
- uses: actions/upload-artifact@v3
with:
name: pages-coverage-html
path: .phpunit/coverage
docs:
name: Docs
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v3
- name: Setup PHP 8.2.9 with Xdebug
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
tools: composer, phive
- name: Restore Composer package cache
uses: actions/cache@v3
with:
path: |
~/.cache/composer/files
~/.cache/composer/vcs
key: "composer-v2-cache-8.2.9-${{ hashFiles('./composer.json') }}"
restore-keys: |
composer-v2-cache-
- name: Install Composer dependencies
run: composer install --prefer-dist --no-interaction
- name: Install phpDocumentor
run: composer install-php-documentor
- name: Generate phpDocumentor html
run: composer docs-ci
- uses: actions/upload-artifact@v3
with:
name: pages-docs-html
path: ./docs-build
package:
name: Package
needs: [index, coverage, docs]
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: true
steps:
- uses: actions/download-artifact@v3
with:
name: pages-index-html
path: ./
- uses: actions/download-artifact@v3
with:
name: pages-coverage-html
path: ./coverage
- name: Copy favicon to /coverage
run: |
cp ./favicon.ico ./coverage/favicon.ico
- uses: actions/download-artifact@v3
with:
name: pages-docs-html
path: ./docs
- name: Copy favicon to /docs
run: |
cp ./favicon.ico ./docs/favicon.ico
- name: Fix permissions
run: |
chmod -c -R +rX "./" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
- uses: actions/upload-pages-artifact@v2
with:
name: github-pages
path: ./
publish:
name: Publish
needs: [package]
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: true
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2