-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (42 loc) · 1.9 KB
/
build-deploy.yml
File metadata and controls
49 lines (42 loc) · 1.9 KB
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
name: Build and deploy jekyll-stage.legumeinfo.org or www.legumeinfo.org
on: [pull_request, push]
jobs:
github-pages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 0 # Increment this number if you need to re-download cached gems
- name: build site
run: bundle exec jekyll build --profile --trace
- name: install html-proofer
run: gem install html-proofer -v 5.0.8
- name: run html-proofer
# always exit with status 0 for now, until the list of HTML grievances can be managed
# --disable-external included for efficiency, eventually remove?
run: htmlproofer --disable-external --assume-extension --empty-alt-ignore --ignore-files '/uikit/tests/' ./_site || exit 0
- name: Deploy (stage)
uses: peaceiris/actions-gh-pages@v3
# Deploy on push to default branch (generally "main"), despite htmlproofer errors (eventually remove)
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && always()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_site
publish_branch: 'jekyll-stage.legumeinfo.org'
cname: jekyll-stage.legumeinfo.org
- name: Deploy (prod)
uses: peaceiris/actions-gh-pages@v3
# Always deploy for now, despite htmlproofer errors (eventually remove)
if: github.ref_type == 'tag' && always()
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./_site
external_repository: legumeinfo/legumeinfo.org
publish_branch: www.legumeinfo.org
cname: www.legumeinfo.org