-
-
Notifications
You must be signed in to change notification settings - Fork 10
40 lines (38 loc) · 1.26 KB
/
deploy.yaml
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
name: Deploy
on:
push:
tags:
- 'v*'
jobs:
build:
name: Deploy Whatsticker to Server
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Executing remote ssh commands on server
uses: appleboy/[email protected]
env:
RELEASE: ${{github.ref_name}}
BEARER_ACCESS_TOKEN: ${{ secrets.BEARER_ACCESS_TOKEN }}
VERIFY_TOKEN: ${{ secrets.VERIFY_TOKEN }}
PASSWORD: ${{ secrets.PASSWORD }}
WHATSTICKER_DIR: ./sandbox/testing/whatsticker/
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
envs: RELEASE,WHATSTICKER_DIR, BEARER_ACCESS_TOKEN, VERIFY_TOKEN, PASSWORD
script: |
cd $WHATSTICKER_DIR
docker-compose down
git reset --hard HEAD
git fetch --all --tags --prune
git checkout --force $RELEASE
git pull -f
docker-compose up --build --detach
until $(curl --output /dev/null --silent --head --fail http://localhost:9000); do
printf 'waiting for whatsticker to come up'
sleep 5
done
echo "$PASSWORD" | sudo -S nginx -s reload