-
Notifications
You must be signed in to change notification settings - Fork 2
65 lines (55 loc) · 1.71 KB
/
update-from-wiki.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Update static site on wiki edit
on: [gollum, push]
jobs:
update-submodule:
name: Update submodule
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
submodules: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Update submodule
run: |
git submodule foreach git fetch --all
git submodule foreach git reset --hard origin/master
- name: Commit updated submodule
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Updating based on latest wiki changes
file_pattern: wiki .gitmodules
build-static-pages:
name: Build static pages
needs: update-submodule
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
with:
ref: master
submodules: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- name: Restore gems from cache
uses: actions/cache@v2
env:
cache-name: ruby-gems-cache
with:
path: ./.gems
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-
- name: Install gems
run: bundle install --path=./.gems --jobs=9
- name: Build site
run: bundle exec rake
- name: Deploy to Github Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: build