-
Notifications
You must be signed in to change notification settings - Fork 70
76 lines (64 loc) · 2.04 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
70
71
72
73
74
75
on:
push:
branches:
- main
permissions:
contents: write
jobs:
build-and-test:
name: Deploy site on ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
matrix:
target: [haskellorg, githubpages]
ghc: ["9.2.5"]
cabal: ["3.10.1"]
steps:
- name: Check out repo
uses: actions/checkout@v3
- name: Install Haskell Toolchain
uses: haskell/actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- name: Configure the build plan
working-directory: message-index
run: |
cabal update
cabal build --dry-run
# cabal build --dry-run creates dist-newstyle/cache/plan.json
# Keep a watch on this `cabal-3.9 build --dry-run` bug:
# https://github.com/haskell/cabal/issues/8706
- name: Read the Cabal cache
uses: actions/cache@v3
with:
path: |
~/.cabal/store
message-index/dist-newstyle
key: |
cabal-cache-ghc-${{ matrix.ghc }}-cabal-${{ matrix.cabal }}-${{ hashFiles('**/plan.json') }}
restore-keys: |
cabal-cache-ghc-${{ matrix.ghc }}-cabal-${{ matrix.cabal }}-
- name: Build with Hakyll
working-directory: message-index
run: cabal run site build
- name: Deploy on Github Pages
uses: peaceiris/actions-gh-pages@v3
if: ${{ (matrix.target == 'githubpages') && (github.ref == 'refs/heads/main') }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./message-index/_site
- name: Deploy on Haskell.org
if: ${{ matrix.target == 'haskellorg' }}
shell: bash
env:
# Create the secret with:
#
# Settings -> Secrets -> New Repository Secret ->
#
# Name: ERRORS_HASKELL_ORG_SSH_KEY
# Value: The text of the ssh private key
ERRORS_HASKELL_ORG_SSH_KEY: ${{ secrets.ERRORS_HASKELL_ORG_SSH_KEY }}
run: |
sudo apt-get install -y lftp
./deploy.sh --DEPLOY-IT-LIVE