Skip to content

CI: redeploy ok-dspace on pushes to clarin-v7#175

Draft
kosarko wants to merge 3 commits into
clarin-v7from
cicd/dispatch-ok-dspace
Draft

CI: redeploy ok-dspace on pushes to clarin-v7#175
kosarko wants to merge 3 commits into
clarin-v7from
cicd/dispatch-ok-dspace

Conversation

@kosarko

@kosarko kosarko commented Jul 22, 2026

Copy link
Copy Markdown
Member

Replaces the commented-out deploy: stub with a deploy-ok-dspace job that notifies
ufal/dspace-k8s once the image this test environment consumes
has been pushed. Target environment: https://ok-dspace.dyn.cloud.e-infra.cz.

The old stub targeted the dataquest docker-compose instances (dev-5/dev-8) we no longer have
access to, which is why it was commented out rather than maintained.

This job records a version; it does not deploy. It sends a repository_dispatch; dspace-k8s
pins the tag to git and a reconciler inside the cluster applies it. No deployment step and no cluster
credential exists in this repository — or anywhere in GitHub.

  • needs: [dspace-angular-dist], not dspace-angular — the latter builds the -dev suffixed
    image, while the overlay runs the unsuffixed dist image. Easy to get backwards.
  • Runs only for pushes to clarin-v7 in ufal/dspace-angular, so a pull request builds the
    image but never triggers a deploy, and forks never fire it.
  • secrets.OK_DSPACE_DEPLOY_TOKEN is a fine-grained PAT scoped to ufal/dspace-k8s with
    Contents: write, which is what POST /repos/{owner}/{repo}/dispatches requires. It is already
    configured as an organisation secret.

Worth knowing: the deploy verification on the other side reads this application's commit from
/static/VERSION_D, which scripts/sourceversion.py generates at image build time — so that script
staying wired up in docker.yml is now load-bearing for confirming a deploy actually landed.

Depends on ufal/dspace-k8s#39, which defines the deploy-ok-dspace dispatch type. This PR is
inert until that merges.

…branch

Sends a repository_dispatch to ufal/dspace-k8s once the images this environment
consumes have actually been pushed. That repository pins the tag to git and an
in-cluster reconciler applies it, so this job records a version and nothing
more - no deployment step and no cluster credential exists here, or anywhere in
GitHub.

Runs only for pushes to the default branch of the canonical repository, so a
pull request builds images but never triggers a deploy.

The token is a fine-grained PAT scoped to ufal/dspace-k8s with Contents: write,
which is what POST /repos/{owner}/{repo}/dispatches requires. A workflow's own
GITHUB_TOKEN cannot act on another repository, so this credential is
unavoidable; it is held as an organisation secret shared with this repository.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Docker image workflow to notify ufal/dspace-k8s (via repository_dispatch) after the ufal/dspace-angular dist image has been pushed on pushes to clarin-v7, enabling ok-dspace’s cluster-side reconciler to pick up and apply the new version.

Changes:

  • Replaces the old commented-out deploy stub with a real deploy-ok-dspace job.
  • Gates the notification job to only run on pushes to clarin-v7 in ufal/dspace-angular and only after dspace-angular-dist completes.
  • Triggers ufal/dspace-k8s via peter-evans/repository-dispatch@v4 with a payload containing the frontend component and commit SHA.

Comment thread .github/workflows/docker.yml Outdated
The section header said "Redeploy" and the step was called "Trigger
deployment", but this job only sends a repository_dispatch - the deploying
happens in ufal/dspace-k8s and, ultimately, in the cluster. Renamed both so the
workflow logs say what ran.

Also names `clarin-v7` explicitly instead of "the default branch", since that
is the literal value the guard matches and the two could drift apart.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment on lines +83 to +85
needs: [dspace-angular-dist]
runs-on: ubuntu-latest
steps:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, fixed in 94eb17a. permissions: {} added to the job — it authenticates with the PAT and never touches GITHUB_TOKEN, so inheriting packages: write was pure blast radius.

Applied the same change to the equivalent job in ufal/clarin-dspace#1393 for consistency, though there the inherited set is only contents: read.

The job authenticates with a fine-grained PAT and never uses GITHUB_TOKEN, but
inherited the workflow-level permissions anyway - including `packages: write` in
dspace-angular, which it has no use for. `permissions: {}` limits what a
compromised third-party action could reach from this job.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants