-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
88 lines (69 loc) · 2.31 KB
/
main.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
name: Build static sites
# Controls when the action will run. Triggers the workflow on push
# events but only for the 11.x branch
on:
push:
branches: [11.x]
jobs:
build:
name: Build and Push
runs-on: ubuntu-latest
steps:
- name: Checkout 11.x
uses: actions/checkout@v2
- name: Checkout gh-pages branch
uses: actions/checkout@v2
with:
ref: gh-pages
path: gh-pages
fetch-depth: 0
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install mkdocs-material mkdocs-git-authors-plugin mkdocs-git-revision-date-localized-plugin pymdown-extensions git+https://gitlab.com/blacs30/mkdocs-edit-url.git
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
extensions: dom, curl, gd, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite
coverage: none
tools: composer:v2
- name: Install Composer dependencies
run: composer install --prefer-dist --no-interaction
- name: Install Drupal
run: composer sut:si
env:
UNISH_DB_URL: sqlite://sites/default/files/.ht.sqlite
- name: Drush status
run: ./drush --uri=dev st
- name: Drush mk:docs
run: composer mk:docs
- name: Mkdocs build
run: mkdocs build -v --site-dir gh-pages/latest
- name: Install Doctum
run: composer doctum-install
- name: Doctum build
run: |
rm -rf gh-pages/latest/api
composer api
- name: Checkout CNAME+redirect+404 files
# They got wiped and are needed.
run: |
cd gh-pages && git checkout -- CNAME index.html 404.html
- name: Commit static site to gh-pages
run: |
cd gh-pages
git config --local user.email "[email protected]"
git config --local user.name "Drush Documentation Bot"
git add -A .
if git diff-index --quiet HEAD --; then
echo "No changes..."
else
git commit -m "[CI] Build static site"
fi
- name: Git Push
run: cd gh-pages && git push