-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (46 loc) · 1.24 KB
/
go.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
name: Github actions demo
on:
push:
branches:
- master
jobs:
build:
name: golang
runs-on: ubuntu-latest
steps:
- name: environment prepare stage
env:
MY_VAR: Hi there! My name is
FIRST_NAME: Zhang
LAST_NAME: Yi
run:
echo $MY_VAR $FIRST_NAME $LAST_NAME.
- name: Set up Go 1.13 stage
uses: actions/setup-go@v1
id: go
with:
go-version: 1.13.6
- name: Checkout stage
uses: actions/checkout@master
- name: build stage
run: go build -o server .
# - name: Unit test stage
# run: go test -v .
- name: Deploy stage
uses: easingthemes/ssh-deploy@v2.1.2
env:
SSH_PRIVATE_KEY: ${{ secrets.SERVER_SSH_KEY }}
ARGS: ${{ secrets.ARGS }}
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
SOURCE: "server"
TARGET: ${{ secrets.REMOTE_TARGET }}
- name: ssh
uses: fifsky/ssh-action@master
with:
command: |
cd /data/auto/go
./start.sh resume
host: ${{ secrets.REMOTE_HOST }}
user: root
key: ${{ secrets.SERVER_SSH_KEY}}