-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (48 loc) · 1.63 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
name: Deploy
on:
workflow_dispatch:
push:
branches:
- proof-of-concept
concurrency:
group: test-local-${{ github.ref }}
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
script: |
cd /root/ds-etna
git pull
docker compose pull
docker compose up -d
docker compose up -d --build --force-recreate nginx
cleanup:
runs-on: ubuntu-latest
needs:
- deploy
steps:
- uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
script: if df -hP -k /dev/sda1 | awk '{if ($5+0>=80) exit 1}'; then echo "Space OK"; else docker system prune --force --all --volumes; fi
tests:
runs-on: ubuntu-latest
needs:
- deploy
env:
GH_TOKEN: ${{ secrets.ACTIONS_GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Run tests
run: gh workflow run manual.yml --repo nationalarchives/ds-tna-website-tests --raw-field domain=https://develop.tna.dblclk.dev --raw-field notify-slack=true --raw-field description="$(git log -1 --pretty=%B | sed '/./,$!d' | sed '/^$/d' | sed 's/^/> /')"
- name: Output link
run: echo "[Test run](https://github.com/nationalarchives/ds-tna-website-tests/actions/workflows/manual.yml)" >> $GITHUB_STEP_SUMMARY