-
Notifications
You must be signed in to change notification settings - Fork 169
50 lines (44 loc) · 1.89 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
on:
push:
branches:
- master
- feature-internals
name: Deploy test instance
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Install SSH key
uses: shimataro/[email protected]
with:
key: ${{ secrets.SSH_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
- name: Deploy to server
env:
TARGET_HOST_02: dev.emailengine.app
NODE_ENV: production
SERVICE_NAME: emailengine
id: deploy
run: |
echo $GITHUB_SHA > commit.txt
./update-info.sh
npm install --omit=dev
tar czf /tmp/${SERVICE_NAME}.tar.gz --exclude .git .
scp -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" /tmp/${SERVICE_NAME}.tar.gz deploy@${TARGET_HOST_02}:
ssh -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" deploy@$TARGET_HOST_02 "/opt/deploy.sh ${SERVICE_NAME}"
- name: Deploy to demo server
env:
TARGET_HOST_02: dev.emailengine.app
NODE_ENV: production
SERVICE_NAME: emailengine-demo
id: deploy-demo
run: |
echo $GITHUB_SHA > commit.txt
./update-info.sh
npm install --omit=dev
tar czf /tmp/${SERVICE_NAME}.tar.gz --exclude .git .
scp -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" /tmp/${SERVICE_NAME}.tar.gz deploy@${TARGET_HOST_02}:
ssh -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" deploy@$TARGET_HOST_02 "/opt/deploy.sh ${SERVICE_NAME}"