untagged-05eed74ec9445357d8e2 #1
Workflow file for this run
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: Publish Docker image for Huawei Registry | |
on: | |
release: | |
types: [published] | |
jobs: | |
build: | |
name: Push Docker image to Huawei SWR Docker Hub | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Log in to Huawei SWR | |
uses: docker/login-action@v2 | |
with: | |
registry: swr.ap-southeast-1.myhuaweicloud.com | |
username: ${{ secrets.DOCKERHUB_USERNAME }} # 配置dockerhub的认证,在Github项目主页 【Settings】 -> 【Secrets】 添加对应变量 | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v3 # 抽取项目信息,主要是镜像的tag | |
with: | |
images: swr.ap-southeast-1.myhuaweicloud.com/storyboard/monkey-tools-common | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v4 # docker build & push | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=registry,ref=${{ steps.meta.outputs.tags }} | |
cache-to: type=inline | |
provenance: false |