更新1.2.0示例图 #15
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: docker | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
# Prepare Docker Image Tags | |
- name: Docker meta 🐳 | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
shalldie/tnote | |
tags: | | |
type=semver,pattern={{version}} | |
type=sha | |
type=raw,value=latest | |
# Add support for more platforms with QEMU (optional) | |
- name: Set up QEMU 🐳 | |
uses: docker/setup-qemu-action@v3 | |
# Set up Docker Buildx | |
- name: Set up Docker Buildx 🐳 | |
uses: docker/setup-buildx-action@v3 | |
# 登陆 Docker Hub | |
- name: Login Docker Hub 🐳🐳 | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_NAME }} | |
password: ${{ secrets.DOCKER_PSW }} | |
# 构建并推送 docker 镜像 | |
- name: Build & Push Docker Image 🐳🐳🐳 | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
file: ./Dockerfile | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} |