Update build_docker.yml #55
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: build_docker | |
on: | |
push: | |
branches: [home] | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
# 这里用于定义 GITHUB_TOKEN 的权限 | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
# 配置 QEMU 和 buildx 用于多架构镜像的构建 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v1 | |
# 登录到 GitHub Packages 容器仓库 | |
# 注意 secrets.GITHUB_TOKEN 不需要手动添加,直接就可以用 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# 构建并上传 | |
- name: Build and push | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
file: ./Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
- name: Inspect image | |
run: | | |
docker buildx imagetools inspect \ | |
ghcr.io/soapmancn/optimalipcloudflaredns:home |