-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (81 loc) · 2.13 KB
/
staging.yaml
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Bingo
on:
push:
tags:
- "v*"
branches:
# - develop
- feature/ci
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run Unit tests.
run: make cover
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: coverage
path: ./_output/coverage.out
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Generate pb files
run: make protoc
- name: Build by Docker Compose
run: bash ./scripts/docker/build.sh -a amd64
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: download-files
path: |
_output/*.tar.gz
publish:
name: Deploy Staging
needs:
- test
- build
runs-on: ubuntu-latest
environment: staging
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v4
id: download-files
with:
name: download-files
path: ./_output
- name: Display structure of downloaded files
run: |
ls -l
- name: Setup ssh-agent
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.REMOTE_KEY }}
- name: Deploy
run: bash ./scripts/docker/deploy.sh ${{ secrets.REMOTE_USER }} ${{ secrets.REMOTE_HOST }}