-
Notifications
You must be signed in to change notification settings - Fork 4
82 lines (62 loc) · 2.11 KB
/
golang.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
name: golang-构建和提交docker
on:
push:
branches: [main]
paths:
- "golang/**"
- ".github/workflows/golang.yml"
- "!**.md"
jobs:
# 并发构建
setup-build-publish-v3:
runs-on: ubuntu-latest
name: 构建和推送docker镜像v3
steps:
- name: 更新代码
# 使用action库 actions/checkout获取源码
uses: actions/checkout@v3
# ########## rsync ###########################
-
name: 登录 Docker Hub
uses: docker/login-action@v2
with:
username: adockero
password: ${{ secrets.PASSWORD }}
- name: 构建镜像 http-shell:alpine
uses: docker/build-push-action@v3
with:
# Comma-delimited list of tags. These will be added to the registry/repository to form the image's tags
tags: adockero/http-shell:alpine
# Path to the Dockerfile (Default is '{path}/Dockerfile')
context: ./golang/http_shell
file: "./golang/http_shell/Dockerfile"
# Always attempt to pull a newer version of the image
# pull: true
push: true
# 构建参数
build-args: |
LATEST_FROM_BASE=alpine
# ZABBIX_VERSION_BIG=6.2
# ZABBIX_VERSION=6.2-4
# APK_ARG=rsync
# Adds labels with git repository information to the built image
labels: true
- name: 构建镜像 http-shell
uses: docker/build-push-action@v3
with:
# Comma-delimited list of tags. These will be added to the registry/repository to form the image's tags
tags: adockero/http-shell:latest
# Path to the Dockerfile (Default is '{path}/Dockerfile')
context: ./golang/http_shell
file: "./golang/http_shell/Dockerfile"
# Always attempt to pull a newer version of the image
# pull: true
push: true
# 构建参数
# build-args: |
# FROM_ARG=16.04
# ZABBIX_VERSION_BIG=6.2
# ZABBIX_VERSION=6.2-4
# APK_ARG=rsync
# Adds labels with git repository information to the built image
labels: true