Skip to content

优化提示

优化提示 #14

Workflow file for this run

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