-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (64 loc) · 2.38 KB
/
Copy pathgithub-pages.yml
File metadata and controls
77 lines (64 loc) · 2.38 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Build and deploy Jigsaw site to GitHub Pages
on:
push:
branches:
- deploy
jobs:
github-pages:
runs-on: ubuntu-latest
env:
JEKYLL_PAT: ${{ secrets.JEKYLL_PAT }}
JEKYLL_GITHUB_TOKEN: ${{ secrets.JEKYLL_PAT }}
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.4.0
with:
access_token: ${{ secrets.JEKYLL_PAT }}
- name: Checkout Codebase
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
ini-values: max_execution_time=3000
coverage: none
- name: Get Composer Cache Directory
id: composer-cache-dir
shell: bash
run: echo "dir=$(composer config cache-files-dir)" >> ${GITHUB_OUTPUT}
- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
- name: Cache Composer Files
id: composer-cache # use this to check for `cache-hit` ==> if: steps.composer-cache.outputs.cache-hit != 'true'
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache-dir.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Cache NPM Packages
uses: actions/cache@v3
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Composer Development dependencies
run: composer install --no-ansi --no-interaction --no-progress
- name: NPM Install
run: npm install
- name: NPM Build
run: npm run prod --pretty=false
- name: Build Jigsaw Site
run: ./vendor/bin/jigsaw build production --pretty=false
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.JEKYLL_PAT }}
personal_token: ${{ secrets.JEKYLL_PAT }}
publish_dir: ./build_production
publish_branch: master
cname: www.nickmoline.com