Composite GitHub Action that triggers an ELN image tag update on dj-gitops. After a dashboard image is built and pushed, this action dispatches a repository_dispatch event that creates an auto-PR to update the tenant's kustomize overlay newTag. Merging that PR triggers an ArgoCD sync to deploy the new image.
Create a fine-grained personal access token (or classic PAT) with repo scope on datajoint-company/dj-gitops. A single token is used for all dashboard repos.
Add the PAT as an organization secret named GITOPS_DISPATCH_TOKEN in each GitHub org that has dashboard repos. This makes the secret available to all dashboard repos in that org without per-repo configuration.
In your dashboard repo's eln-build-publish.yaml (or equivalent), add the dispatch step after the image push step. See Usage below.
For repos that already have eln-build-publish.yaml:
- Add
GITOPS_DISPATCH_TOKENas an org secret (once per GitHub org) - Add the action step at the end of the build job
- Remove any manual deployment steps (the old
deploy-elnworkflow in dj-gitops no longer exists)
For the template repo used to create new dashboard projects, update the template's workflow so all new repos include the dispatch step automatically.
Add this step to your dashboard build workflow after the image push:
- name: Update GitOps image tag
uses: datajoint-company/eln-dispatch-action@v1
with:
tenant_name: org_project
image_tag: ${{ steps.meta.outputs.version }}
environment: prod
token: ${{ secrets.GITOPS_DISPATCH_TOKEN }}name: Build and Deploy ELN Dashboard
on:
push:
tags:
- '*'
jobs:
build-and-dispatch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build and push image
# ... your existing build steps ...
- name: Update GitOps image tag
uses: datajoint-company/eln-dispatch-action@v1
with:
tenant_name: org_project
image_tag: ${{ github.ref_name }}
environment: prod
token: ${{ secrets.GITOPS_DISPATCH_TOKEN }}| Input | Required | Default | Description |
|---|---|---|---|
tenant_name |
Yes | ELN tenant overlay directory name (e.g., org_project). Must match [a-zA-Z0-9_-]+. |
|
image_tag |
Yes | Image tag to deploy (e.g., 1.2.0-sha-abc123). Must match [a-zA-Z0-9._-]+. |
|
environment |
Yes | prod |
Target environment: qa or prod. |
token |
Yes | GitHub token with repo scope on datajoint-company/dj-gitops. |
dj-gitopsreceives theeln-image-updateeventupdate_service_images.pyvalidates the payload and updatesnewTaginapplications/k8s/kustomization/eln/overlay/{environment}/{tenant_name}/kustomization.yamlpeter-evans/create-pull-requestcreates a PR titledchore: update {tenant_name} ({environment})- Merging the PR triggers ArgoCD to sync the new image (~3-5 min)