-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (46 loc) · 1.57 KB
/
deployment.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
name: Deployment
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build Docker Image
run: |
mkdir ./keys
echo '${{ secrets.CREDENTIALS }}' > ./keys/credentials.json
CHARACTER_COUNT=$(wc -c < ./keys/credentials.json)
echo "Character count: $CHARACTER_COUNT"
# - name: Checkout
# uses: actions/checkout@v3
# - name: Build Docker Image
# run: |
# docker build -t karirku-backend .
# - name: Save Docker Image as TAR File
# run: |
# docker save -o karirku-backend.tar karirku-backend
# - name: Send TAR File to Server
# uses: appleboy/[email protected]
# with:
# host: ${{ secrets.DEPLOYMENT_HOST }}
# username: ${{ secrets.DEPLOYMENT_HOST_USERNAME }}
# key: ${{ secrets.DEPLOYMENT_HOST_KEY }}
# port: 22
# source: karirku-backend.tar
# target: images/
# - name: Run Docker Image
# uses: appleboy/[email protected]
# with:
# host: ${{ secrets.DEPLOYMENT_HOST }}
# username: ${{ secrets.DEPLOYMENT_HOST_USERNAME }}
# key: ${{ secrets.DEPLOYMENT_HOST_KEY }}
# port: 22
# script: |
# docker container rm -f karirku-backend
# docker image rm -f karirku-backend
# docker load -i images/karirku-backend.tar
# docker run --name karirku-backend -d --restart always -p 8000:8000 karirku-backend