更新 .gitea/workflows/patch.yml
All checks were successful
Create and publish a Docker image / build-and-push-image (push) Successful in 37s

Signed-off-by: yoshino-s <cy-cui@outlook.com>
This commit is contained in:
2025-05-27 07:49:10 +00:00
parent 1c950f649c
commit dfb5ba18d4

View File

@@ -12,7 +12,7 @@ on:
# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
env:
REGISTRY: git.yoshino-s.xyz
IMAGE_NAME: ${{ github.repository }}/mock-server
IMAGE_NAME: ${{ github.repository }}
# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
jobs:
@@ -30,12 +30,6 @@ jobs:
registry: ${{ env.REGISTRY }}
username: ${{ gitea.repository_owner }}
password: ${{ secrets.PACKAGES_PASSWORD }}
# This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels.
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Replace tag
run: |
sed -i "s/latest/${{ gitea.event.inputs.tag }}/g" Dockerfile
@@ -49,5 +43,4 @@ jobs:
context: .
file: Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ gitea.event.inputs.tag }}