forked from nus-cs2103-AY2021S1/tp
49 lines (41 loc) · 1.16 KB
/
build-jekyll.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
name: Build and Deploy to GitHub Pages
on:
push:
branches:
- master
defaults:
run:
working-directory: docs
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Set up Ruby
- uses: actions/setup-ruby@v1
with:
ruby-version: '2.7'
# Cache dependencies on server
- uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
# Install dependencies
- name: Install dependencies
run: |
gem install bundler
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
# Build Jekyll site
- name: Build
env:
JEKYLL_ENV: production
run: bundle exec jekyll build --baseurl /${{ github.event.repository.name }} # Set the repo name as the base URL
# Deploy to GitHub Pages
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_site