Skip to content

fix path

fix path #16

Workflow file for this run

name: 推送开发用的 docker 镜像
on:
push:
branches:
- 'develop'
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
push_to_registry:
name: 构建并推送
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
# https://github.com/actions/checkout
- name: 拉取代码
uses: actions/checkout@v4
with:
ref: develop
# https://github.com/docker/login-action
- name: 登录到 ghcr
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# https://github.com/docker/metadata-action
- name: 提取事件元数据
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# https://github.com/docker/setup-buildx-action
- name: 使用 buildx 作为构建器
uses: docker/setup-buildx-action@v3
# https://github.com/docker/build-push-action
- name: 构建并推送
uses: docker/build-push-action@v5
with:
context: .
file: .docker/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max