-
Notifications
You must be signed in to change notification settings - Fork 3
37 lines (34 loc) · 1.12 KB
/
backend-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
name: Backend Deploy
on:
push:
branches: [develop]
paths:
- backend/**
workflow_dispatch:
jobs:
deploy-testnet:
environment:
name: testnet
url: https://testnet-api.explorer.rgbpp.io/graphql
runs-on: ubuntu-latest
steps:
- name: Deploy to testnet
uses: appleboy/[email protected]
env:
# GIT_BRANCH is used as a part of cache key prefix
GIT_BRANCH: 'develop'
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd ${{ secrets.SSH_WORK_DIR }}
git status
git fetch origin
git checkout ${{ github.sha }}
git status
echo ${{ secrets.SSH_PASSWORD }} | sudo -S docker compose ps
echo ${{ secrets.SSH_PASSWORD }} | sudo -S docker image prune -f
echo ${{ secrets.SSH_PASSWORD }} | sudo -S docker compose build
echo ${{ secrets.SSH_PASSWORD }} | sudo -S docker compose up -d
echo ${{ secrets.SSH_PASSWORD }} | sudo -S docker compose ps