Skip to content

Commit ec5eddf

Browse files
committed
Add GitHub Action to update the documentation
1 parent d859d9b commit ec5eddf

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

.github/workflows/documentation.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Documentation
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 15 * *'
6+
7+
jobs:
8+
sponsors:
9+
name: Update documentation
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout the code
15+
uses: actions/checkout@v4
16+
with:
17+
ref: gh-pages
18+
19+
- name: Setup PHP
20+
uses: shivammathur/setup-php@v2
21+
with:
22+
php-version: 8.3
23+
tools: composer:v2
24+
25+
- name: Get composer cache directory
26+
id: composer-cache
27+
shell: bash
28+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
29+
30+
- name: Cache composer dependencies
31+
uses: actions/cache@v4
32+
with:
33+
path: ${{ steps.composer-cache.outputs.dir }}
34+
key: "documentation-${{ hashFiles('**/composer.json') }}"
35+
restore-keys: "documentation-${{ hashFiles('**/composer.json') }}"
36+
37+
- name: Install dependencies
38+
uses: nick-fields/retry@v3
39+
if: steps.composer-cache.outputs.cache-hit != 'true'
40+
with:
41+
timeout_minutes: 10
42+
max_attempts: 3
43+
command: composer update --prefer-dist --no-progress --prefer-stable
44+
45+
- name: Update sponsors on readme.md
46+
run: composer release
47+
48+
- name: Create Pull Request
49+
uses: peter-evans/create-pull-request@v7
50+
with:
51+
branch: job/update-documentation
52+
commit-message: Update documentation
53+
title: Update documentation
54+
body: Monthly automated documentation update
55+
assignees: kylekatarnls
56+
reviewers: kylekatarnls
57+
add-paths: :!history.json

0 commit comments

Comments
 (0)