Skip to content

Commit 52d70f0

Browse files
committed
Avoid code duplication between deploy.yml and deploy2.yml
1 parent 4ba5488 commit 52d70f0

File tree

2 files changed

+22
-57
lines changed

2 files changed

+22
-57
lines changed

.github/workflows/deploy.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ permissions:
99
jobs:
1010

1111
build-and-test:
12-
name: Build site
12+
name: Deploy site on ${{ matrix.target }}
1313
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
target: [haskellorg, githubpages]
1417

1518
steps:
1619
- name: Install GHC 9.2.5
@@ -39,9 +42,25 @@ jobs:
3942
working-directory: message-index
4043
run: cabal run site build
4144

42-
- name: Deploy
45+
- name: Deploy on Github Pages
4346
uses: peaceiris/actions-gh-pages@v3
44-
if: ${{ github.ref == 'refs/heads/main' }}
47+
if: ${{ (matrix.target == 'githubpages') && (github.ref == 'refs/heads/main') }}
4548
with:
4649
github_token: ${{ secrets.GITHUB_TOKEN }}
4750
publish_dir: ./message-index/_site
51+
52+
- name: Deploy on Haskell.org
53+
if: ${{ matrix.target == 'haskellorg' }}
54+
shell: bash
55+
env:
56+
# Create the secret with:
57+
#
58+
# Settings -> Secrets -> New Repository Secret ->
59+
#
60+
# Name: ERRORS_HASKELL_ORG_SSH_KEY
61+
# Value: The text of the ssh private key
62+
ERRORS_HASKELL_ORG_SSH_KEY: ${{ secrets.ERRORS_HASKELL_ORG_SSH_KEY }}
63+
run: |
64+
sudo apt-get install -y lftp
65+
./deploy.sh --DEPLOY-IT-LIVE
66+

.github/workflows/deploy2.yml

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)