-
-
Notifications
You must be signed in to change notification settings - Fork 7
61 lines (51 loc) · 1.81 KB
/
publish-wiki.yml
File metadata and controls
61 lines (51 loc) · 1.81 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
name: Publish wiki
on:
push:
branches:
- 'main'
paths:
- wiki/**
- .github/workflows/publish-wiki.yml
# Do a dry-run (check, no deploy) for PRs.
pull_request:
# Allow running this workflow manually from the Actions tab.
workflow_dispatch:
# Allow this workflow to be triggered from outside.
repository_dispatch:
types:
- 'phpcs-release'
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "publish-wiki"
cancel-in-progress: false
permissions:
contents: write
jobs:
publish-wiki:
name: "Publish Wiki"
if: github.repository == 'PHPCSStandards/PHP_CodeSniffer-documentation'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install DocToc table of contents generator
run: npm install -g doctoc
- name: Copy wiki files to temporary location
shell: bash
run: cp -v -a wiki _wiki
- name: Update tables of contents
run: doctoc ./_wiki/ --github --maxlevel 4 --update-only
- name: Re-run tables of contents with different settings for specific file
run: doctoc ./_wiki/Version-4.0-User-Upgrade-Guide.md --github --maxlevel 3 --update-only
- name: Deploy to wiki
uses: Andrew-Chen-Wang/github-wiki-action@v4
env:
COMMIT_MSG: ${{ github.event.head_commit.message }}
with:
strategy: 'clone'
path: '_wiki/'
commit-message: ${{ env.COMMIT_MSG }}
# repository: PHPCSStandards/PHP_CodeSniffer
# token: ${{ secrets.PHPCS_GITHUB_TOKEN }}
dry-run: ${{ github.event_name == 'pull_request' }}