alpine image -> 300M #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 构建和提交docker | |
on: | |
push: | |
branches: [main] | |
paths: | |
- "./**" | |
- ".github/workflows/alpine.yml" | |
- "!**.md" | |
jobs: | |
# 并发构建 | |
setup-build-publish-v3: | |
runs-on: ubuntu-latest | |
name: 构建和推送docker镜像v3 | |
steps: | |
- name: 更新代码 | |
# 使用action库 actions/checkout获取源码 | |
uses: actions/checkout@v3 | |
- | |
name: 登录 Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.USERNAME }} | |
password: ${{ secrets.PASSWORD }} | |
# ########## 构建 ########################### | |
# - name: 构建与推送 | |
# uses: docker/build-push-action@v1.1.0 | |
# with: | |
# # Username used to log in to a Docker registry. If not set then no login will occur | |
# username: ${{ secrets.USERNAME }} | |
# # Password or personal access token used to log in to a Docker registry. If not set then no login will occur | |
# password: ${{ secrets.PASSWORD }} | |
# # Docker repository to tag the image with | |
# repository: adockero/electerm-web | |
# # Comma-delimited list of tags. These will be added to the registry/repository to form the image's tags | |
# # tags: debug | |
# # Path to the Dockerfile (Default is '{path}/Dockerfile') | |
# path: ./ | |
# dockerfile: Dockerfile | |
# # Always attempt to pull a newer version of the image | |
# always_pull: true | |
# # 构建参数 | |
# # build_args: GIT_BRANCH=master | |
# # Adds labels with git repository information to the built image | |
# add_git_labels: true | |
- name: 构建与推送--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: ${{ secrets.USERNAME }}/electerm-web | |
# Path to the Dockerfile (Default is '{path}/Dockerfile') | |
context: ./ | |
file: "./Dockerfile.alpine" | |
# Always attempt to pull a newer version of the image | |
pull: true | |
push: true | |
# 构建参数 | |
# build-args: | | |
# FROM_ARG=node:11-alpine | |
# APK_ARG=rsync | |
# Adds labels with git repository information to the built image | |
labels: true | |