File tree Expand file tree Collapse file tree 2 files changed +87
-0
lines changed Expand file tree Collapse file tree 2 files changed +87
-0
lines changed Original file line number Diff line number Diff line change
1
+ on :
2
+ push :
3
+ branches :
4
+ - main
5
+ - test-deploy # This is to be deleted once it works
6
+
7
+ permissions :
8
+ contents : write
9
+
10
+ jobs :
11
+
12
+ build-and-test :
13
+ name : Build site
14
+ runs-on : ubuntu-latest
15
+
16
+ steps :
17
+ - name : Install GHC 9.2.5
18
+ run : ghcup install ghc 9.2.5
19
+
20
+ - name : Select GHC 9.2.5
21
+ run : ghcup set ghc 9.2.5
22
+
23
+ - name : Check out repo
24
+ uses : actions/checkout@v3
25
+
26
+ - name : Read the Cabal cache
27
+ uses : actions/cache@v3
28
+ with :
29
+ path : |
30
+ ~/.cabal/store
31
+ message-index/dist-newstyle
32
+ key : cabal-cache-0-${{ hashFiles('message-index/message-index.cabal') }}
33
+ restore-keys : |
34
+ cabal-cache-0
35
+
36
+ - name : Update the Cabal index
37
+ run : cabal update
38
+
39
+ - name : Check if site.hs is formatted using ormolu
40
+ uses : mrkkrp/ormolu-action@v6
41
+ with :
42
+ pattern : |
43
+ **/site.hs
44
+
45
+ - name : Build with Hakyll
46
+ working-directory : message-index
47
+ run : cabal run site build
48
+
49
+ - name : Deploy
50
+ shell : bash
51
+ env :
52
+ # Create the secret with:
53
+ #
54
+ # Settings -> Secrets -> New Repository Secret ->
55
+ #
56
+ # Name: ERRORS_HASKELL_ORG_SSH_KEY
57
+ # Value: The text of the ssh private key
58
+ ERRORS_HASKELL_ORG_SSH_KEY : ${{ secrets.ERRORS_HASKELL_ORG_SSH_KEY }}
59
+ run : |
60
+ sudo apt-get install -y lftp
61
+ ./deploy.sh --DEPLOY-IT-LIVE
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ # TODO: make this with tempfile
4
+ KEYFILE=$( mktemp keyXXXXXXXX)
5
+
6
+ echo " ${ERRORS_HASKELL_ORG_SSH_KEY} " > " $KEYFILE "
7
+ chmod 600 " $KEYFILE "
8
+
9
+ if [ " $1 " = --DEPLOY-IT-LIVE ]; then
10
+ DESTINATION=errors
11
+ else
12
+ DESTINATION=errors-test
13
+ fi
14
+
15
+ # This can go away once we're hosted entirely on haskell.org infra by
16
+ # renaming the file. GH pages wants it to be called 404.html, while
17
+ # h.o wants it to be called 404-page.html.
18
+ cp ./message-index/_site/404.html ./message-index/_site/404-page.html
19
+
20
+ # WARNING: --delete is dangerous. Be absolutely sure you are
21
+ # deploying to the correct directory. Existing contents of the
22
+ # destination directory will be removed.
23
+ #
24
+ # Permissions: We have to recursively set write permissions because
25
+ # lftp isn't able to remove a file if its directory is not writeable.
26
+ lftp --norc -c " set net:max-retries 1; set sftp:connect-program \" ssh -o StrictHostKeyChecking=no -a -x -i $KEYFILE \" ; open -u error-index, sftp://webhost.haskell.org; chmod --recursive u+w $DESTINATION ; mirror --verbose --reverse --transfer-all ./message-index/_site $DESTINATION "
You can’t perform that action at this time.
0 commit comments