-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (70 loc) · 1.85 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
71
72
73
74
75
76
77
78
79
name: Production Deployment
on:
push:
branches:
- staging
pull_request:
branches:
- staging
jobs:
linter:
name: linters
runs-on: ubuntu-latest
steps:
- name: checkout staging
uses: actions/checkout@v4
- name: install Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: v1.62.2
tests:
runs-on: ubuntu-latest
needs: linter
steps:
- name: checkout staging
uses: actions/checkout@v4
- name: install Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Test
run: go test -v ./...
deploy:
name: deploy
needs: tests
runs-on: ubuntu-latest
steps:
- name: pull code
uses: appleboy/ssh-action@master
with:
host: kanban-pumpkin.ru
username: ubuntu
key: ${{ secrets.PRIVATE_KEY }}
script: cd /home/ubuntu/back && git pull
- name: build golang
uses: appleboy/ssh-action@master
with:
host: kanban-pumpkin.ru
username: ubuntu
key: ${{ secrets.PRIVATE_KEY }}
script: cd /home/ubuntu/back && make build_all -j
- name: build containers
uses: appleboy/ssh-action@master
with:
timeout: 200m
command_timeout: 200m
host: kanban-pumpkin.ru
username: ubuntu
key: ${{ secrets.PRIVATE_KEY }}
script: cd /home/ubuntu/back && sudo docker compose build
- name: restart service
uses: appleboy/ssh-action@master
with:
host: kanban-pumpkin.ru
username: ubuntu
key: ${{ secrets.PRIVATE_KEY }}
script: cd /home/ubuntu/back && sudo docker compose up -d