-
Notifications
You must be signed in to change notification settings - Fork 313
75 lines (63 loc) · 2.35 KB
/
build-docs.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
name: Build Docs
on:
push:
branches:
- trunk
pull_request:
branches:
- develop
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
path: 'wp-content/plugins/elasticpress'
- name: Set PHP version
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
coverage: none
ini-values: memory_limit=3G
- name: composer install
run: composer install
- name: Start MySQL
run: |
sudo systemctl start mysql.service
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: Install WP-CLI
run: |
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp
- name: Install WordPress
run: |
wp core download
wp config create --dbname=wpclidocs --dbuser=root --dbpass=root --dbhost=127.0.0.1
wp db create
wp core install --url=example.com --title=Example --admin_user=supervisor --admin_password=strongpassword [email protected]
wp plugin activate elasticpress
- name: Generate WP-CLI Docs
run: |
wp package install felipeelia/cli-command-docs:dev-trunk
wp cli-command-docs elasticpress --custom-order=sync,activate-feature,deactivate-feature,list-features,get-algorithm-version,set-algorithm-version --remove=delete_transient_on_int,custom_get_transient,stop_on_failed_mapping,call_ep_cli_put_mapping,should_interrupt_sync,index_output,get-indexes,get-cluster-indexes,index,clear-index,get-indexing-status,get-last-cli-index,stop-indexing --custom-intro='The following WP-CLI commands are supported by ElasticPress:' > wp-content/plugins/elasticpress/docs/wp-cli.md
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: '18'
- name: npm ci, and build docs
run: |
cd wp-content/plugins/elasticpress
npm ci
npm -g install gulp-cli
npm run build:docs
env:
CI: true
- name: Deploy to GH Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: './wp-content/plugins/elasticpress/docs-built'