-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (57 loc) · 1.7 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: CI/CD for sibylla
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.23"
- name: Install dependencies
run: go mod download
working-directory: sibylla_service
- name: Run tests
run: go test ./...
working-directory: sibylla_service
- name: Build binary
run: GOOS=linux GOARCH=amd64 go build -o sibylla ./cmd/sibylla_service
working-directory: sibylla_service
- name: List files before copy
run: ls -R
working-directory: sibylla_service
- name: Copy static files
run: mkdir -p static_copy && cp -r static/* static_copy/
working-directory: sibylla_service
- name: List files after copy
run: ls -R static_copy
working-directory: sibylla_service
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Copy files to server
uses: appleboy/scp-action@v0.0.4
with:
host: ${{ secrets.DO_DROPLET_IP }}
username: ${{ secrets.DO_SSH_USER }}
key: ${{ secrets.DO_SSH_KEY }}
source: "sibylla_service/**"
target: "/root/"
port: 22
timeout: 30s
command_timeout: 1m
strip_components: 0
- name: Restart service on Droplet
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.DO_DROPLET_IP }}
username: ${{ secrets.DO_SSH_USER }}
key: ${{ secrets.DO_SSH_KEY }}
script: |
sudo systemctl restart sibylla