-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (40 loc) · 1.21 KB
/
gh-pages.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
name: Push website to gh-pages branch
on:
push:
paths:
- 'website/**/*'
- '.github/workflows/gh-pages.yml'
branches:
- 'main'
# workflow_call:
release:
types: [published, unpublished, edited]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
push-to-gh-pages:
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
steps:
- uses: actions/checkout@v3
- name: Install ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
working-directory: website
- name: Build site
run: |
cd website
bundle exec jekyll build
cd ..
- name: Push website directory as subtree to branch gh-pages
run: |
git config user.name github-actions
git config user.email [email protected]
git add -f website/_site
git commit -m "Website build"
git subtree split --branch gh-pages --prefix website/_site/
git push origin gh-pages --force