Skip to content

Commit 3895536

Browse files
Added GitHub Actions for the docs generation
1 parent eef214c commit 3895536

File tree

2 files changed

+103
-0
lines changed

2 files changed

+103
-0
lines changed

.github/workflows/changelog.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: changelog
2+
3+
on:
4+
release:
5+
types:
6+
- released
7+
8+
permissions: write-all
9+
10+
jobs:
11+
update:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v3
17+
18+
- name: Setup PHP
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv, json
22+
coverage: none
23+
24+
- name: Git setup
25+
if: success()
26+
run: |
27+
git config --local user.email "action@github.com"
28+
git config --local user.name "GitHub Action"
29+
30+
- name: Update
31+
uses: stefanzweifel/changelog-updater-action@v1
32+
if: success()
33+
with:
34+
release-date: ${{ steps.release_date.outputs.date }}
35+
release-notes: ${{ github.event.release.body }}
36+
latest-version: ${{ github.event.release.tag_name }}
37+
compare-url-target-revision: ${{ github.event.release.target_commitish }}
38+
path-to-changelog: docs/prologue/changelog/3.x.md
39+
40+
- name: Storing
41+
id: changelog
42+
if: success()
43+
run: |
44+
IS_DIRTY=1
45+
46+
{ git add . && git commit -a -m "🧾 Update CHANGELOG"; } || IS_DIRTY=0
47+
48+
echo ::set-output name=is_dirty::${IS_DIRTY}
49+
50+
- name: Push changes
51+
uses: ad-m/github-push-action@master
52+
if: success() && steps.changelog.outputs.is_dirty == 1
53+
with:
54+
github_token: ${{ secrets.COMPOSER_TOKEN }}

.github/workflows/docs.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: docs
2+
3+
on:
4+
push:
5+
workflow_run:
6+
workflows:
7+
- changelog
8+
types:
9+
- completed
10+
workflow_dispatch:
11+
12+
permissions: write-all
13+
14+
jobs:
15+
generate:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
with:
21+
fetch-depth: 0
22+
token: ${{ secrets.GITHUB_TOKEN }}
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v3
26+
27+
- name: Cache dependencies
28+
uses: actions/cache@v3
29+
id: npm-cache
30+
with:
31+
path: |
32+
**/node_modules
33+
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
34+
restore-keys: |
35+
${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
36+
37+
- name: Install dependencies
38+
run: npm i
39+
40+
- name: Build VuePress site
41+
run: npm run build
42+
43+
- name: Deploy to GitHub Pages
44+
uses: crazy-max/ghaction-github-pages@v3.0.0
45+
with:
46+
target_branch: gh-pages
47+
build_dir: docs/.vuepress/dist
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)