-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (45 loc) · 1.28 KB
/
Copy pathdeploy.yml
File metadata and controls
53 lines (45 loc) · 1.28 KB
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
name: Deploy to Production
on:
push:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup GHC
uses: haskell-actions/setup@v2
with:
ghc-version: '9.6'
cabal-version: 'latest'
- name: Cache cabal store
uses: actions/cache@v4
with:
path: ~/.cabal/store
key: cabal-${{ runner.os }}-ghc9.6-${{ hashFiles('cabal.project', '**/*.cabal') }}
restore-keys: |
cabal-${{ runner.os }}-ghc9.6-
- name: Update package index
run: cabal update
- name: Build all packages
run: cabal build all
- name: Run tests (excluding WebSocket tests)
run: cabal test all --test-option="--skip=/WebSocket protocol/"
deploy:
needs: test
runs-on: ubuntu-latest
steps:
- name: Deploy via SSH
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd ~/Splendor
git pull origin master
docker compose up --build -d
sudo systemctl reload nginx
docker image prune -f