Skip to content

Commit 4d0a478

Browse files
committed
feat(ci): update Docker and release workflows for improved version handling and manual triggering
1 parent f13b6e7 commit 4d0a478

2 files changed

Lines changed: 30 additions & 6 deletions

File tree

.github/workflows/docker.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
11
name: Build and Push Docker Image
22

3+
# NOTE: This workflow is intended to be run manually (via workflow_dispatch)
4+
# or called by other workflows (via workflow_call). It no longer triggers
5+
# automatically on push or tag events — use the `release.yml` workflow to
6+
# invoke this workflow as part of the release pipeline.
7+
38
on:
4-
push:
5-
branches:
6-
- main
7-
tags:
8-
- 'v*'
99
workflow_dispatch:
10+
workflow_call:
11+
inputs:
12+
LAZYDNS_VERSION:
13+
required: false
14+
type: string
15+
secrets:
16+
DOCKERHUB_TOKEN:
17+
required: true
18+
DOCKERHUB_USERNAME:
19+
required: true
20+
GITHUB_TOKEN:
21+
required: true
1022

1123
jobs:
1224
docker:
@@ -62,4 +74,4 @@ jobs:
6274
cache-from: type=gha
6375
cache-to: type=gha,mode=max
6476
build-args: |
65-
LAZYDNS_VERSION=${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || 'latest' }}
77+
LAZYDNS_VERSION=${{ inputs.LAZYDNS_VERSION || (startsWith(github.ref, 'refs/tags/') && github.ref_name) || 'latest' }}

.github/workflows/release.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,3 +217,15 @@ jobs:
217217
env:
218218
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_API_TOKEN }}
219219
run: cargo publish
220+
221+
# Trigger Docker build/push workflow (reusable workflow)
222+
docker:
223+
name: Trigger Docker Build and Push
224+
needs: publish
225+
uses: ./.github/workflows/docker.yml
226+
with:
227+
LAZYDNS_VERSION: ${{ github.ref_name }}
228+
secrets:
229+
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
230+
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
231+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)