generated from chevere/docs-deploy
-
Notifications
You must be signed in to change notification settings - Fork 1
109 lines (92 loc) · 3.24 KB
/
build.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Build
on:
workflow_dispatch:
repository_dispatch:
push:
branches:
- main
jobs:
build:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ["8.2"]
env:
extensions: opcache, mbstring, ds, pcov
tools: composer
ini-values: opcache.enable_cli = 1, precision=16, default_charset='UTF-8', pcov.directory=src
key: cache-1613673233781
name: PHP ${{ matrix.php-versions }} test on ${{ matrix.operating-system }}
steps:
- name: Checkout
uses: actions/checkout@master
- name: Checkout docs
uses: actions/checkout@v2
with:
repository: ${{ secrets.REPO_DOCS }}
token: ${{ secrets.REPO_DOCS_ACCESS_TOKEN }}
path: docs
- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}
- name: Cache extensions
uses: actions/cache@v2
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ steps.extcache.outputs.key }}
restore-keys: ${{ steps.extcache.outputs.key }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
ini-values: ${{ env.ini-values }}
coverage: pcov
tools: ${{ env.tools }}
env:
fail-fast: true
- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Validate composer
run: composer validate
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --prefer-dist --no-progress --classmap-authoritative
- name: Copy .vuepress/ contents to docs/.vuepress/
run: cp -rf .vuepress/. docs/.vuepress/
- name: Build with PHP
run: php build.php
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Show dir contents
run: ls -la docs/.vuepress
- name: vuepress-deploy
uses: jenkey2011/vuepress-deploy@v1
env:
ACCESS_TOKEN: ${{ secrets.REPO_HOSTING_ACCESS_TOKEN }}
TARGET_REPO: ${{ secrets.REPO_HOSTING }}
TARGET_BRANCH: main
BUILD_SCRIPT: yarn && yarn build
BUILD_DIR: docs/.vuepress/dist/
CNAME: ${{ secrets.CNAME }}