Skip to content

Commit 4960dfa

Browse files
refactor: Move deployer distribution to release-please yml
1 parent 315d873 commit 4960dfa

File tree

2 files changed

+47
-2
lines changed

2 files changed

+47
-2
lines changed

.github/workflows/deployer-image.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ jobs:
5151
type=semver,pattern={{version}}
5252
type=raw,value=latest,enable={{is_default_branch}}
5353
54-
- name: Build (and push on main/tags)
54+
- name: Build (no push)
5555
uses: docker/build-push-action@v6
5656
with:
5757
context: .
5858
file: ./confidence-cloudflare-resolver/deployer/Dockerfile
59-
push: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) }}
59+
push: false
6060
build-args: |
6161
COMMIT_SHA=${{ github.sha }}
6262
platforms: linux/amd64

.github/workflows/release-please.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,49 @@ jobs:
6060
env:
6161
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6262

63+
publish-deployer-image:
64+
needs: release
65+
if: ${{ needs.release.outputs.release_created == 'true' }}
66+
runs-on: ubuntu-latest
67+
permissions:
68+
contents: read
69+
packages: write
70+
steps:
71+
- name: Checkout
72+
uses: actions/checkout@v4
73+
74+
- name: Set up QEMU
75+
uses: docker/setup-qemu-action@v3
76+
77+
- name: Set up Docker Buildx
78+
uses: docker/setup-buildx-action@v3
79+
80+
- name: Log in to GHCR
81+
uses: docker/login-action@v3
82+
with:
83+
registry: ghcr.io
84+
username: ${{ github.actor }}
85+
password: ${{ secrets.GITHUB_TOKEN }}
86+
87+
- name: Docker meta
88+
id: meta
89+
uses: docker/metadata-action@v5
90+
with:
91+
images: ghcr.io/${{ github.repository_owner }}/confidence-cloudflare-deployer
92+
tags: |
93+
type=raw,value=${{ needs.release.outputs.tag_name }}
94+
type=raw,value=latest
95+
96+
- name: Build and push deployer image
97+
uses: docker/build-push-action@v6
98+
with:
99+
context: .
100+
file: ./confidence-cloudflare-resolver/deployer/Dockerfile
101+
push: true
102+
build-args: |
103+
COMMIT_SHA=${{ github.sha }}
104+
platforms: linux/amd64
105+
tags: ${{ steps.meta.outputs.tags }}
106+
labels: ${{ steps.meta.outputs.labels }}
107+
63108

0 commit comments

Comments
 (0)