-
Notifications
You must be signed in to change notification settings - Fork 2
33 lines (32 loc) · 1.26 KB
/
ci-workflow.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
name: Backend CI update
on:
push:
branches:
- master
jobs:
build:
# Job name is Greeting
name: Image build
# This job runs on Linux
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip ci')"
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Login to Docker Hub
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PWD }}
- name: Build image
run: make build
- name: Push to Docker Hub
run: make release
- name: Load changes on production instance
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.DEPLOY_KEY }}
script: |
docker stop backend
docker rm backend
docker pull xcart/prognosis-app:latest
docker run -d --network shared --env XB_PASSWORD=${{ secrets.XB_PASSWORD }} --env YOUTRACK_TOKEN=${{ secrets.YOUTRACK_TOKEN }} --env SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_GOOGLE_CLIENTID=${{ secrets.GOOGLE_CLIENTID }} --env SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_GOOGLE_CLIENTSECRET=${{ secrets.GOOGLE_CLIENTSECRET }} --name backend xcart/prognosis-app:latest