-
Notifications
You must be signed in to change notification settings - Fork 2
78 lines (63 loc) · 1.58 KB
/
release.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Release
on:
push:
tags:
- 'v*'
env:
DOCKER_IMAGE: leocomelli/secrets-init
jobs:
test-build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: set up golang
uses: actions/setup-go@v2
with:
go-version: '1.17.5'
- name: checkout
uses: actions/checkout@v2
- name: golangci lint
uses: golangci/golangci-lint-action@v2
- name: testing
run: make test
- name: build
run: make build
env:
CGO_ENABLED: 0
- name: create release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
- name: github release
uses: softprops/action-gh-release@v1
with:
draft: true
files: |
dist/secrets-init_linux-amd64
name: ${{ github.ref }}
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- name: set up docker buildx
uses: docker/setup-buildx-action@v1
- name: dockerhub login
uses: docker/login-action@v1
if: success()
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: get tag
id: tag
uses: dawidd6/action-get-tag@v1
with:
strip_v: true
- name: build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ env.DOCKER_IMAGE }}:latest,${{ env.DOCKER_IMAGE }}:${{steps.tag.outputs.tag}}