-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (63 loc) · 2.28 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Jekyll build
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main and staging branches
on:
pull_request:
branches: [ main, staging ]
push:
branches: [ main, staging ]
# globals
env:
MUSCAT_GUIDELINES_REPO: rism-digital/muscat-guidelines
MUSCAT_REPO: rism-digital/muscat
TRANSLATIONS_REPO: rism-digital/translations
MUSCAT_GUIDELINES_PATH: 'muscat-guidelines'
MUSCAT_PATH: 'muscat'
TRANSLATIONS_PATH: 'translations'
BUILD_PATH: 'build'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: "Install ruby"
uses: actions/setup-ruby@v1
with:
ruby-version: '3.1'
# Checks-out external repositories
- uses: actions/checkout@v4
with:
repository: ${{ env.MUSCAT_GUIDELINES_REPO }}
path: ${{ env.MUSCAT_GUIDELINES_PATH }}
- uses: actions/checkout@v4
with:
repository: ${{ env.MUSCAT_REPO }}
path: ${{ env.MUSCAT_PATH }}
- uses: actions/checkout@v4
with:
repository: ${{ env.TRANSLATIONS_REPO }}
path: ${{ env.TRANSLATIONS_PATH }}
# Checks-out this repository under $BUILD_PATH
- uses: actions/checkout@v4
with:
path: ${{ env.BUILD_PATH }}
- name:
working-directory: ${{ env.BUILD_PATH }}
run: sed -i 's/https:\/\/guidelines\.rism\.info/https:\/\/guidelines-stage\.rism\.info/g' _config.yml
if: endsWith(github.ref, '/staging')
# Use GitHub Actions' cache to shorten build times and decrease load on servers
- uses: actions/cache@v3
with:
path: ${{ env.BUILD_PATH }}/vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}-v3
restore-keys: |
${{ runner.os }}-gems-v3
- name: "Build the site"
working-directory: ${{ env.BUILD_PATH }}
run: |
bundle config path vendor/bundle
bundle install
bundle exec jekyll build