generated from hydephp/hyde
-
-
Notifications
You must be signed in to change notification settings - Fork 3
76 lines (58 loc) · 1.9 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
name: Build the site
on:
push:
branches: [ master ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Validate composer.json and composer.lock
run: composer validate
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Create dotenv
run: echo "SITE_URL=https://hydephp.com/" > .env
- name: Add Torchlight token
run: echo "TORCHLIGHT_TOKEN=${{ secrets.TORCHLIGHT_TOKEN }}" >> .env
- name: Install composer dependencies
run: composer install --prefer-dist
- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install Node dependencies
run: npm install
- name: Build frontend assets
run: npm run prod
- name: Run the Hyde Builder
run: php hyde build --pretty-urls --run-prettier --no-interaction
- name: Create .nojekyll
run: touch docs/.nojekyll
- name: Create CNAME
run: echo "hydephp.com" > docs/CNAME
- name: Create docs redirect
run: echo '<meta http-equiv="refresh" content="0;url=/docs/1.x" />' > docs/docs/index.html
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
add: 'docs'
message: 'Build the site'