-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (50 loc) · 1.93 KB
/
ci.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
name: build
on: [push, pull_request]
jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- name: set up go 1.23
uses: actions/setup-go@v4
with:
go-version: '1.23'
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v4
# - name: build and test
# run: |
# go test -v -race -timeout=100s -covermode=atomic -coverprofile=$GITHUB_WORKSPACE/profile.cov_tmp ./...
# go build -race ./...
# cat $GITHUB_WORKSPACE/profile.cov_tmp | grep -v "mocks" | grep -v "_mock" > $GITHUB_WORKSPACE/profile.cov
# working-directory: app
# env:
# TZ: America/Chicago
# - name: golangci-lint
# uses: golangci/golangci-lint-action@v3
# with:
# version: v1.58
# - name: install goveralls
# run: go install github.com/mattn/goveralls@latest
# - name: submit coverage
# run: $(go env GOPATH)/bin/goveralls -service="github" -coverprofile=$GITHUB_WORKSPACE/profile.cov
# env:
# COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: build and push master image
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
env:
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }}
USERNAME: ${{ github.actor }}
run: |
docker build -t radiot/tg-retrans:master .
echo ${DOCKER_HUB_TOKEN} | docker login -u umputun --password-stdin
docker push radiot/tg-retrans:master
- name: build and push tagged image
if: github.event_name == 'push' && github.event.ref_type == 'tag'
run: |
GIT_TAG="${GITHUB_REF#refs/tags/}"
docker build -t radiot/tg-retrans:${GIT_TAG} .
echo ${DOCKER_HUB_TOKEN} | docker login -u umputun --password-stdin
docker push radiot/tg-retrans:${GIT_TAG}
docker tag radiot/tg-retrans:${GIT_TAG} radiot/tg-retrans:latest
docker push radiot/tg-retrans:latest