-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (43 loc) · 2.22 KB
/
deploy-production.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
name: Deploy-to-DO-production
on:
push:
branches:
- release
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Review API - Publish to Github Packages Registry
uses: elgohr/Publish-Docker-Github-Action@v5
env:
GIT_ACCESS_TOKEN_CURL_CONFIG_KUCLAP_API_REVIEW: ${{ secrets.GIT_ACCESS_TOKEN_CURL_CONFIG_KUCLAP_API_REVIEW }}
ARG_AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
ARG_AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
ARG_AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
with:
name: kuclap/kuclap-review/kuclap-review-api
registry: docker.pkg.github.com
username: ${{ secrets.GIT_USERNAME }}
password: ${{ secrets.GITHUB_TOKEN }}
dockerfile: ./docker/Prod.Dockerfile
tags: '1.1.0, latest'
buildargs: GIT_ACCESS_TOKEN_CURL_CONFIG_KUCLAP_API_REVIEW,ARG_AWS_ACCESS_KEY_ID,ARG_AWS_SECRET_ACCESS_KEY,ARG_AWS_DEFAULT_REGION
- name: Deploy package to digitalocean
uses: appleboy/ssh-action@master
env:
GIT_USERNAME: ${{ secrets.GIT_USERNAME }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
host: ${{ secrets.DO_GANDALF_HOST }}
username: ${{ secrets.DO_GANDALF_USERNAME }}
password: ${{ secrets.DO_GANDALF_PASSWORD }}
port: ${{ secrets.DO_GANDALF_PORT }}
envs: GIT_USERNAME, GITHUB_TOKEN
script: |
docker stop kuclap-review-api
docker container prune -f
docker image prune -f
docker login docker.pkg.github.com -u $GIT_USERNAME -p $GITHUB_TOKEN
docker pull docker.pkg.github.com/kuclap/kuclap-review/kuclap-review-api:latest
docker run --name kuclap-review-api --network=kuclap --restart=always -dit -p 8008:8000 docker.pkg.github.com/kuclap/kuclap-review/kuclap-review-api:latest