Use docker-tags plugin for flexible image tagging

Add generate-tags step with branch, sha, edge, build number, and
semver tag formats. Enable tag events for release workflows.
This commit is contained in:
2026-01-28 23:44:52 -08:00
parent 8621903d19
commit 7789e0054a

View File

@@ -1,16 +1,25 @@
when: when:
- event: [push, pull_request, manual] - event: [push, pull_request, manual, tag]
steps: steps:
- name: generate-tags
image: ghcr.io/abh/woodpecker-docker-tags-plugin:sha-86e52ce
settings:
tags: |
branch
sha
edge
raw -v build-${CI_PIPELINE_NUMBER}
semver --format {{major}}
semver --format {{major}}.{{minor}}
semver --format {{major}}.{{minor}}.{{patch}}
- name: docker - name: docker
image: woodpeckerci/plugin-kaniko image: woodpeckerci/plugin-kaniko
settings: settings:
dockerfile: Dockerfile dockerfile: Dockerfile
registry: harbor.ntppool.org registry: harbor.ntppool.org
repo: library/static-web repo: library/static-web
tags:
- ${CI_COMMIT_SHA:0:7}
- ${CI_COMMIT_BRANCH}
cache: true cache: true
username: username:
from_secret: harbor_library_username from_secret: harbor_library_username