-
Notifications
You must be signed in to change notification settings - Fork 33
123 lines (105 loc) · 3.45 KB
/
prerelease.yml
File metadata and controls
123 lines (105 loc) · 3.45 KB
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# name of the action
name: prerelease
# trigger on push events with `v*` in tag
on:
push:
tags:
- "v*"
permissions:
contents: read
# pipeline to execute
jobs:
prerelease:
runs-on: ubuntu-latest
steps:
- name: clone
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
# ensures we fetch tag history for the repository
fetch-depth: 0
- name: install go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
# use version from go.mod file
go-version-file: "go.mod"
cache: true
check-latest: true
- name: setup
run: |
# setup git tag in Actions environment
echo "GITHUB_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: build
env:
GOOS: linux
CGO_ENABLED: "1"
run: |
make build-static-ci
- name: login to dockerhub
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: extract metadata
id: meta
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
with:
images: target/vela-server
tags: |
# only on push tag, "raw" because {{version}} strips "v" prefix
type=semver,pattern={{raw}}
- name: build and push image
id: push
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
prerelease_alpine:
runs-on: ubuntu-latest
steps:
- name: clone
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
# ensures we fetch tag history for the repository
fetch-depth: 0
- name: install go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
# use version from go.mod file
go-version-file: "go.mod"
cache: true
check-latest: true
- name: setup
run: |
# setup git tag in Actions environment
echo "GITHUB_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: build
env:
GOOS: linux
CGO_ENABLED: "1"
run: |
make build-static-ci
- name: login to dockerhub
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: extract metadata
id: meta
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
with:
images: target/vela-server
tags: |
# only on push tag, "raw" because {{version}} strips "v" prefix
type=semver,pattern={{raw}},suffix=-alpine
- name: build and push image
id: push
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
with:
context: .
file: ./Dockerfile-alpine
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}