-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (42 loc) · 1.26 KB
/
main.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
name: Build & Deploy Dragd
on:
push:
branches:
- "main"
jobs:
lazy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and export
uses: docker/build-push-action@v4
with:
context: .
tags: dragd:latest
secrets: |
"BASE_SITE=index"
"MONGO_STRING=${{ secrets.MONGO_CONNECTION_STRING }}"
outputs: type=docker,dest=./dragd.tar
- name: Upload docker file to server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.SSH_HOST_2 }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
source: "./dragd.tar"
target: "/root"
- name: Deploy Dragd v2
uses: appleboy/[email protected]
with:
host: ${{secrets.SSH_HOST_2}}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
script: |
docker load < dragd.tar
docker stop dragd
docker rm dragd
docker run --net="host" -d --name="dragd" dragd
docker system prune -f