-
Notifications
You must be signed in to change notification settings - Fork 8
80 lines (77 loc) · 2.95 KB
/
deploy-dev.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
76
77
78
79
80
# This is a deploy workflow to test server
name: CI Deploy Dev
on:
workflow_dispatch:
jobs:
call-workflow-build:
uses: townteki/townsquare-client/.github/workflows/build.yml@master
deploy-dev:
runs-on: ubuntu-latest
needs: call-workflow-build
steps:
- uses: actions/checkout@v2
- name: Git update
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.REMOTE_TEST_HOST }}
username: ${{ secrets.REMOTE_TEST_USER }}
key: ${{ secrets.TEST_SERVER_SSH_KEY }}
script: |
cd ${{ secrets.REMOTE_TEST_TARGET }}
git fetch
git reset --hard origin/development
git clean -fd
git submodule update --remote
- name: Update from PT
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.REMOTE_TEST_HOST }}
username: ${{ secrets.REMOTE_TEST_USER }}
key: ${{ secrets.TEST_SERVER_SSH_KEY }}
script: |
cd ${{ secrets.REMOTE_TEST_TARGET }}/../townsquare-ptdt
git fetch
git reset --hard origin/playtest
git clean -fd
cp -r server/game/cards/XX-PT ${{ secrets.REMOTE_TEST_TARGET }}/server/game/cards 2>/dev/null || :
cp /townsquare-dev/pt-data/public/img/cards/* /townsquare-dev/townsquare/public/img/cards/
cp -r /townsquare-dev/pt-data/townsquare-json-data/* /townsquare-dev/townsquare/townsquare-json-data/
- name: Cleanup
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.REMOTE_TEST_HOST }}
username: ${{ secrets.REMOTE_TEST_USER }}
key: ${{ secrets.TEST_SERVER_SSH_KEY }}
script: |
rm -f ${{ secrets.REMOTE_TEST_TARGET }}/public/* || true
rm -f ${{ secrets.REMOTE_TEST_TARGET }}/public/img/* || true
rm -r ${{ secrets.REMOTE_TEST_TARGET }}/public/fonts || true
rm -r ${{ secrets.REMOTE_TEST_TARGET }}/public/sound || true
- name: Get built dist
uses: actions/download-artifact@v2
with:
name: dist
path: dist
- name: Deploy dist to Server
uses: easingthemes/[email protected]
env:
SSH_PRIVATE_KEY: ${{ secrets.TEST_SERVER_SSH_KEY }}
ARGS: "-rltgoDzvO"
SOURCE: "dist/"
REMOTE_HOST: ${{ secrets.REMOTE_TEST_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_TEST_USER }}
TARGET: ${{ secrets.REMOTE_TEST_TARGET }}/public
EXCLUDE: "/images/cards/, /node_modules/"
- name: Deploy assets to Server
uses: easingthemes/[email protected]
env:
SSH_PRIVATE_KEY: ${{ secrets.TEST_SERVER_SSH_KEY }}
ARGS: "-rltgoDzvO"
SOURCE: "assets/"
REMOTE_HOST: ${{ secrets.REMOTE_TEST_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_TEST_USER }}
TARGET: ${{ secrets.REMOTE_TEST_TARGET }}/public
call-server-restart:
uses: townteki/townsquare-client/.github/workflows/dev-restart.yml@master
secrets: inherit
needs: deploy-dev