-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (49 loc) · 1.45 KB
/
backend.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
on:
push:
branches:
- master
paths:
- ".github/**"
- "backend/**"
pull_request:
branches:
- master
name: Build Tennis Backend
jobs:
build:
name: Build & Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go environment
uses: actions/setup-go@v5
with:
go-version: "1.23" # The Go version to download (if necessary) and use.
- name: Build
run: |
cd backend
go version
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o tennis-tournament-finder-backend cmd/main.go
pwd
ls -la
- name: Deploy
uses: appleboy/[email protected]
if: github.event_name != 'pull_request'
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.PORT }}
source: "backend/tennis-tournament-finder-backend"
target: ${{ secrets.DEPLOYMENT_PATH }}
strip_components: 1
- name: Restart Service
uses: appleboy/[email protected]
if: github.event_name != 'pull_request'
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.PORT }}
script: supervisorctl restart tennis-tournament-finder-backend