-
Notifications
You must be signed in to change notification settings - Fork 2
63 lines (49 loc) · 1.5 KB
/
build.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
name: build
on:
push:
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- name: Set up Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Print go version
run: go version
- name: Check out code into the Go module directory
uses: actions/checkout@v1
# - name: Git LFS setup
# run: git lfs pull
- name: Build
run: make build
- name: Test
run: make test
- name: Coverage
run: bash <(curl -s https://codecov.io/bash)
- name: Generate build number
uses: einaregilsson/build-number@v2
with:
token: ${{secrets.github_token}}
- name: Setup tag
run: echo "::set-env name=TAG::0.6.$BUILD_NUMBER"
- name: Build docker container
run: |
docker build -t ${{ github.repository }}:$TAG -t ${{ github.repository }}:latest .
echo $DOCKER_PWD | docker login -u $DOCKER_LOGIN --password-stdin
docker push --all-tags ${{ github.repository }}
env:
DOCKER_LOGIN: ${{ secrets.DOCKER_LOGIN }}
DOCKER_PWD: ${{ secrets.DOCKER_PWD }}
- name: Deploy app
run: |
echo "$SSH_IDENTITY_KEY" > identity
chmod 600 identity
ssh -i identity -o StrictHostKeyChecking=no root@proxy.ailinykh.com "/bin/bash ./docker/pullanusbot/deploy_app.sh $TAG"
env:
SSH_IDENTITY_KEY: ${{ secrets.SSH_IDENTITY_KEY }}