Skip to content

ci: request a dev deploy after publishing - #1

Merged
bajtos merged 3 commits into
mainfrom
claude/auto-pick-docker-versions-5tadan
Aug 21, 2026
Merged

ci: request a dev deploy after publishing#1
bajtos merged 3 commits into
mainfrom
claude/auto-pick-docker-versions-5tadan

Conversation

@bajtos

@bajtos bajtos commented Aug 20, 2026

Copy link
Copy Markdown
Member

The dev stage of Forge Central pins plc by image digest, so deploying a merge to
main meant reading the digest ghcr.io/fil-forge/did-method-plc:main now
names and editing infra-central by hand. The publish run already knows that
digest.

build-and-push-ghcr now dispatches a bump-deployed-image event to
fil-forge/infra-central, carrying the digest, the commit and the pull request
it came from. The receiver there opens a pull request pinning the digest with
auto-merge enabled, and infra-central's Check and deploy workflow runs
tofu apply on dev/apps on every push to its main, so merging that pull
request is what deploys. infra-central keys this service as plc.

This workflow triggers on every push, not only main, so the dispatch is gated
on refs/heads/main and on the repository being fil-forge/did-method-plc.
Other refs and forks keep publishing to their own GHCR namespace and stop there
— the same fork-awareness the existing build-and-push-aws job uses. Prod pins
are promoted by hand.

Unlike the sibling services, this workflow has no concurrency block, so two
pushes to main build side by side and finish in whatever order their arm64
legs take. The receiver takes the last dispatch it sees, so an older build could
otherwise repin dev behind a newer one. A tip check immediately before the
dispatch skips when GITHUB_SHA is no longer the tip of main, leaving the pin
to the build that is. Serializing with concurrency would have changed publish
behaviour for every push and fork in this repo, which is wider than this change
needs to be.

Changes

  • .github/workflows/build-and-push-ghcr.yaml: pull-requests: read for
    resolving the source PR, and four new gated steps — resolve the merged PR URL,
    mint a fil-forge-bot token scoped to infra-central, confirm this commit is
    still the tip of main, and POST the dispatch. The existing build step
    already carried id: build-and-push, whose digest output feeds the payload;
    the digest is shape-checked before it is sent. The tip read uses
    GITHUB_TOKEN, since the bot token cannot read this repository.

No README change here: this fork's README.md is the upstream did:plc document,
so the deployment notes live as comments in the workflow to keep upstream syncs
clean. In the other services these notes went into their READMEs.

Requirements

The dispatch runs as the fil-forge-bot GitHub App and needs the
FORGE_BOT_APP_ID variable and the FORGE_BOT_PRIVATE_KEY secret to be
available to this repository.

Related

The dev stage of Forge Central pins plc by image digest, so a deploy meant
reading the digest ghcr.io/fil-forge/did-method-plc:main now names and
editing infra-central by hand. The publish run already knows that digest.

Dispatch a bump-deployed-image event to fil-forge/infra-central, carrying the
digest, the commit and the pull request it came from. The receiver there opens
a pull request pinning the digest with auto-merge enabled, and HCP applies dev
on every commit to main, so merging it is what deploys.

The workflow runs on every push, so the dispatch is gated on refs/heads/main
and on this being fil-forge/did-method-plc: other refs and forks publish to
their own namespace and stop there. Prod pins are promoted by hand.

Refs FIL-1051

Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
Assisted-by: Claude

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5f613eb9e9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/build-and-push-ghcr.yaml
claude added 2 commits August 20, 2026 10:12
This workflow has no concurrency guard, so two pushes to main build side by
side. The arm64 legs decide who finishes first, the receiver takes the last
dispatch it sees, and an older build could therefore repin dev behind a newer
one.

Read the tip of main immediately before dispatching and skip when this commit
is no longer it, leaving the pin to the build that is. The tip comes from
GITHUB_TOKEN: the fil-forge-bot token is scoped to infra-central and cannot
read this repository.

The other services cancel in-flight runs on a newer push to the same ref, so
they do not have this exposure.

Refs FIL-1051

Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
Assisted-by: Claude
infra-central moved off HCP Terraform in fil-forge/infra-central#25: state
lives in S3 and its "Check and deploy" workflow runs tofu apply on dev/apps
on every push to main. The comment added in 5f613eb described the old setup,
which fil-forge/infra-central#33 also corrected on that side.

The mechanism this workflow relies on is unchanged — merging the receiver's
pull request is still what deploys. Only the description was wrong.

Refs FIL-1051

Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
Assisted-by: Claude
@bajtos
bajtos requested a review from alanshaw August 20, 2026 10:16
bajtos added a commit to fil-forge/hilt that referenced this pull request Aug 20, 2026
The `Deploying to dev` section added in #41 says HCP Terraform applies
the dev
workspace. infra-central moved off HCP in fil-forge/infra-central#25 —
state
lives in S3 now, and its `Check and deploy` workflow runs `tofu apply`
on
`dev/apps` (after `apply-platform`) on every push to `main`.
fil-forge/infra-central#33 corrected the same wording on that side.

The mechanism this repo relies on is unchanged: merging the receiver's
pull
request is still what deploys. Only the description was wrong.

### Changes

- `README.md`: replace the HCP sentence, and add a `[deploy]` link to
  `check-and-deploy.yml` next to the existing receiver link.

Docs only — no workflow or code changes.

### Context

Found while porting #41 to the remaining Forge Central services, where
the same
sentence had been copied across. Corrected there in the same series:

- fil-forge/sprue#71
- fil-forge/swarf#6
- fil-forge/delegator#28
- fil-forge/piri-signing-service#17
- fil-forge/did-method-plc#1

### Related

- Linear:
[FIL-1051](https://linear.app/filecoin-foundation/issue/FIL-1051)
- Receiver workflow: fil-forge/infra-central#24


---
_Generated by [Claude
Code](https://claude.ai/code/session_01E7ZDwvCHKi6441uN3NCCnP)_
@bajtos
bajtos merged commit df9ae0a into main Aug 21, 2026
5 checks passed
fil-forge-bot Bot added a commit to fil-forge/infra-central that referenced this pull request Aug 21, 2026
Published from fil-forge/did-method-plc#1

- Digest: `sha256:ebb12470f6fc50906c0ed867d009a056e131db1a994b45d7c3f1c8d2eb26dee9`
- Commit: fil-forge/did-method-plc@df9ae0a
- Publish run: https://github.com/fil-forge/did-method-plc/actions/runs/32491680329

Merging applies [`terraform/envs/dev/apps`](https://github.com/fil-forge/infra-central/tree/main/terraform/envs/dev/apps) with no further confirmation.

Co-authored-by: fil-forge-bot[bot] <318653112+fil-forge-bot[bot]@users.noreply.github.com>
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