Skip to content

Commit 1ab00fa

Browse files
authored
Added cicd for reconcile account topics (#1447)
ref https://linear.app/ghost/issue/BER-3046
1 parent 6ed1a08 commit 1ab00fa

File tree

1 file changed

+64
-1
lines changed

1 file changed

+64
-1
lines changed

.github/workflows/build.yml

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,15 @@ jobs:
256256
with:
257257
token_format: access_token
258258
workload_identity_provider: projects/687476608778/locations/global/workloadIdentityPools/github-oidc-activitypub/providers/github-provider-activitypub
259-
service_account: cicd-activitypub-terraform@ghost-activitypub.iam.gserviceaccount.com
259+
service_account: prd-activitypub-terraform-cicd@ghost-activitypub.iam.gserviceaccount.com
260+
261+
- name: Login to GCP Artifact Registry
262+
if: steps.changes.outputs.populate-explore-json == 'true'
263+
uses: docker/login-action@v3
264+
with:
265+
registry: europe-docker.pkg.dev
266+
username: oauth2accesstoken
267+
password: ${{ steps.gcp-auth.outputs.access_token }}
260268

261269
- name: Build populate explore json job image
262270
if: steps.changes.outputs.populate-explore-json == 'true'
@@ -266,3 +274,58 @@ jobs:
266274
load: true
267275
tags: ${{ steps.populate-explore-json-meta.outputs.tags }}
268276
push: true
277+
278+
build-reconcile-account-topics-job:
279+
name: Build Reconcile Account Topics Job
280+
runs-on: ubuntu-latest
281+
if: github.ref == 'refs/heads/main'
282+
steps:
283+
- name: Checkout
284+
uses: actions/checkout@v4
285+
286+
- name: Check for changes in reconcile account topics job
287+
id: changes
288+
uses: dorny/paths-filter@v3
289+
with:
290+
filters: |
291+
reconcile-account-topics:
292+
- 'jobs/reconcile-account-topics/**'
293+
294+
- name: Set up Docker Buildx
295+
uses: docker/setup-buildx-action@v3
296+
297+
- name: Docker metadata
298+
if: steps.changes.outputs.reconcile-account-topics == 'true'
299+
id: reconcile-account-topics-meta
300+
uses: docker/metadata-action@v5
301+
with:
302+
images: europe-docker.pkg.dev/ghost-activitypub/activitypub/reconcile-account-topics
303+
tags: |
304+
type=sha
305+
type=edge,branch=main
306+
307+
- name: Authenticate with GCP
308+
if: steps.changes.outputs.reconcile-account-topics == 'true'
309+
uses: google-github-actions/auth@v2
310+
id: gcp-auth
311+
with:
312+
token_format: access_token
313+
workload_identity_provider: projects/687476608778/locations/global/workloadIdentityPools/github-oidc-activitypub/providers/github-provider-activitypub
314+
service_account: prd-activitypub-terraform-cicd@ghost-activitypub.iam.gserviceaccount.com
315+
316+
- name: Login to GCP Artifact Registry
317+
if: steps.changes.outputs.reconcile-account-topics == 'true'
318+
uses: docker/login-action@v3
319+
with:
320+
registry: europe-docker.pkg.dev
321+
username: oauth2accesstoken
322+
password: ${{ steps.gcp-auth.outputs.access_token }}
323+
324+
- name: Build reconcile account topics job image
325+
if: steps.changes.outputs.reconcile-account-topics == 'true'
326+
uses: docker/build-push-action@v6
327+
with:
328+
context: jobs/reconcile-account-topics
329+
load: true
330+
tags: ${{ steps.reconcile-account-topics-meta.outputs.tags }}
331+
push: true

0 commit comments

Comments
 (0)