-
Notifications
You must be signed in to change notification settings - Fork 96
69 lines (61 loc) · 1.86 KB
/
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
61
62
63
64
65
66
67
68
69
name: Deploy
# We deploy the site *only* on
#
# 1. A push to master, or
# 2. A manually triggered Deploy build
#
# We don't want to deploy for every branch and PR of course!
on:
push:
branches:
- master
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Nix
uses: cachix/install-nix-action@v20
- name: Cachix
uses: cachix/cachix-action@v12
with:
name: haskell-org
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
# The CI Github Action also builds the site and puts it in an
# artifact. However, downloading an artifact from a different
# workflow seems to be difficult.
#
# https://github.com/actions/download-artifact/issues/3
#
# We'll just build the whole site again here. It only takes a
# couple of minutes.
- name: Build Site
# we run the checks as a separate step
run: >
nix build \
--verbose \
--print-build-logs \
--file . \
built -o built-site \
--arg doCheck false \
--extra-experimental-features nix-command
- name: Check Links
run: >
nix shell \
--quiet \
-f . linkchecker \
--extra-experimental-features nix-command \
-c linkchecker built-site
- name: Deploy
shell: bash
env:
# Create the secret with:
#
# Settings -> Secrets -> New Repository Secret ->
#
# Name: WWW_HASKELL_ORG_SSH_KEY
# Value: The text of the ssh private key
WWW_HASKELL_ORG_SSH_KEY: ${{ secrets.WWW_HASKELL_ORG_SSH_KEY }}
run: |
nix shell --quiet -f . lftp --extra-experimental-features nix-command -c sh ./deploy.sh --DEPLOY-IT-LIVE