-
Notifications
You must be signed in to change notification settings - Fork 20
53 lines (47 loc) · 1.7 KB
/
ci-build.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
52
53
name: CI build
on:
pull_request:
branches:
- master
workflow_dispatch:
jobs:
build:
name: Linux
runs-on: ubuntu-latest
env:
# Control the use of htmlproofer. Set to '1' to enable htmlproofer.
USE_HTMLPROOFER: '0'
steps:
# Clone the repository and checkout into the relevant branch
- uses: actions/checkout@v4
# Install Ruby
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3.4 # Check https://pages.github.com/versions/ for the current Ruby version used by gh pages.
# Install dependencies required to run jekyll build
- name: Install gh-pages rubygem via bundler
run: |
# Update gem and bundler - disabled due to gem install errors on CI
# gem update --system --no-document
gem update bundler --no-document
# Set the bundle directory
bundle config set path vendor/bundle
# Install Gemfile contents via bundler
bundle install
# Build the website via jekyll
- name: Build jekyll website with drafts
run: bundle exec jekyll build --drafts
# Check for broken links if enabled
- name: Check for broken links
if: ${{ env.USE_HTMLPROOFER == '1' }}
run: |
bundle exec htmlproofer --disable-external --allow-hash-href --internal-domains=rse.shef.ac.uk,rse.sheffield.ac.uk --log-level :debug ./_site &> links.log
continue-on-error: true
# Store the list of potentially broken links
- name: Archive log links
if: ${{ env.USE_HTMLPROOFER == '1' }}
uses: actions/upload-artifact@v4
with:
name: links-check.log
path: links.log