generated from greenelab/lab-website-template
-
Notifications
You must be signed in to change notification settings - Fork 2
51 lines (40 loc) · 1.11 KB
/
build-site.yaml
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
name: build-site
run-name: build live site
on:
# run when called from another workflow
workflow_call:
# run if user manually requests it
workflow_dispatch:
# variables
env:
PREVIEWS_FOLDER: preview
permissions:
contents: write
jobs:
build-site:
runs-on: ubuntu-latest
steps:
# for debugging
- name: Print contexts
uses: crazy-max/ghaction-dump-context@v1
- name: Checkout branch contents
uses: actions/checkout@v3
- name: Install Ruby packages
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.0"
bundler-cache: true
- name: Get Pages url
id: pages
uses: actions/configure-pages@v2
with:
enablement: false
- name: Build live version of site
run: |
JEKYLL_ENV=production bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path || '' }}"
- name: Commit live site to Pages branch
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: _site
clean-exclude: ${{ env.PREVIEWS_FOLDER }}
force: false