-
Notifications
You must be signed in to change notification settings - Fork 14
60 lines (55 loc) · 1.54 KB
/
site-deploy.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
# Copyright 2024, Proofcraft Pty Ltd
#
# SPDX-License-Identifier: BSD-2-Clause
# Build and deploy the site
name: Deploy Site
on:
push:
branches:
- master
workflow_dispatch:
jobs:
build:
name: Site
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1 # sets up ruby accourding to .ruby-version and caches bundler deps
with:
bundler-cache: true
- run: make build JEKYLL_ENV=production
- run: tar -cvf site.tar _site/
- uses: actions/upload-artifact@v4
with:
name: site
path: site.tar
deploy:
if: ${{ github.repository_owner == 'seL4' &&
(github.event_name == 'push' ||
github.event_name == 'workflow_dispatch') }}
needs: build
name: 'Deploy'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: gh-pages
token: ${{ secrets.PRIV_REPO_TOKEN }}
# for removing files, we need to start fresh; this does not remove dot-files
# leaves .nojekyll in place
- run: rm -rf *
- uses: actions/download-artifact@v4
with:
name: site
- run: tar -xvf site.tar
- run: cp -a _site/* .
- run: rm -rf site.tar _site
# recreate CNAME file for GitHub; not included in generated site
- run: echo sel4.systems > CNAME
# add/remove everything
- run: git add -A .
- run: git diff --cached
- run: git config user.name "CI"
- run: git config user.email ci@sel4.systems
- run: git commit -m "auto-deployed"
- run: git push