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: | |
- 'app/**' | |
workflow_dispatch: | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 检出代码 | |
uses: actions/checkout@v4 | |
- name: 设置 QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: 设置 Docker Buildx | |
uses: docker/setup-buildx-action@v1.6.0 | |
- name: 登录到 Docker Hub | |
uses: docker/login-action@v3.0.0 | |
with: | |
username: duolabmeng | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: 构建并推送 Docker 镜像 | |
uses: docker/build-push-action@v2.7.0 | |
with: | |
context: . | |
file: Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: duolabmeng/pro-api:latest |