Align image publishing with repository path
This commit is contained in:
@@ -5,6 +5,10 @@ on:
|
|||||||
tags:
|
tags:
|
||||||
- "v*"
|
- "v*"
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY_HOST: code.wanderingbadger.dev
|
||||||
|
IMAGE_NAME: ${{ github.repository }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -24,7 +28,7 @@ jobs:
|
|||||||
- name: Log in to Gitea Container Registry
|
- name: Log in to Gitea Container Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: code.wanderingbadger.dev
|
registry: ${{ env.REGISTRY_HOST }}
|
||||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
|
||||||
@@ -35,5 +39,5 @@ jobs:
|
|||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
code.wanderingbadger.dev/tliu93/home-automation:${{ github.ref_name }}
|
${{ env.REGISTRY_HOST }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}
|
||||||
code.wanderingbadger.dev/tliu93/home-automation:latest
|
${{ env.REGISTRY_HOST }}/${{ env.IMAGE_NAME }}:latest
|
||||||
@@ -236,7 +236,13 @@ docker compose logs -f app
|
|||||||
- workflow 文件:`.github/workflows/docker-image.yml`
|
- workflow 文件:`.github/workflows/docker-image.yml`
|
||||||
- 触发条件:push 匹配 `v*` 的 tag,例如 `v1.0.0`
|
- 触发条件:push 匹配 `v*` 的 tag,例如 `v1.0.0`
|
||||||
- registry:`code.wanderingbadger.dev`
|
- registry:`code.wanderingbadger.dev`
|
||||||
- image:`code.wanderingbadger.dev/tliu93/home-automation`
|
- image:`code.wanderingbadger.dev/<owner>/<repo>`
|
||||||
|
|
||||||
|
当前 workflow 不再把 image name 硬编码到特定 user package 路径,而是直接使用当前仓库标识生成镜像路径:
|
||||||
|
|
||||||
|
- `code.wanderingbadger.dev/${github.repository}:${tag}`
|
||||||
|
|
||||||
|
在 Gitea 这里,package 更贴近 repo 归属的语义,主要体现在镜像命名路径本身,而不是额外的“绑定”动作。也就是说,当前发布方式是按仓库路径约定来对齐 repo/package 语义。
|
||||||
|
|
||||||
这个 workflow 会构建并推送 multi-arch image:
|
这个 workflow 会构建并推送 multi-arch image:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user