-
Notifications
You must be signed in to change notification settings - Fork 3
48 lines (41 loc) · 1.36 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
name: Build and Deploy Website
on: ["push", "pull_request"]
jobs:
build-and-deploy:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.6'
- name: Pull cache if available
uses: actions/cache@v2
with:
path: vendor/bundle
key: bundle-use-ruby-2.6-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
bundle-use-ruby-2.6-
- name: bundle install
run: |
gem install bundler:2.1.4
bundle config deployment true
bundle config path vendor/bundle
bundle install --jobs 4
- name: Build the page
run: |
# Jekyll offers no option for non-zero exit codes on parse errors
# So write some custom code here
#
# c.f. https://github.com/jekyll/jekyll/issues/5257
[ ! $(bundle exec jekyll build | tee /dev/stderr | grep 'Error: YAML Exception') ]
- name: Push to GH Pages
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: _site