Skip to content

Add reusable CI actions and workflows for Rails services - #197

Open
dorner wants to merge 2 commits into
mainfrom
add-reusable-ci-actions-workflows
Open

Add reusable CI actions and workflows for Rails services#197
dorner wants to merge 2 commits into
mainfrom
add-reusable-ci-actions-workflows

Conversation

@dorner

@dorner dorner commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

This PR adds a number of actions that we've introduced in fadmin and related repos over the last little while, so they can be used across the org. It also introduces reusable workflows that can be run from other repos.

Composite actions (common/):

  • common/slack: We have an existing Slack action, but it's fairly static. More importantly, with the removal of LinearB, there's no way to notify users when their workflow fails. The new common/slack sends a notification not only to a channel but also attempts to determine the user's Slack username and sends an @mention.
  • common/buf-generate: cache + buf generate (configurable cache path / template)
  • common/deploy-staging: generic staging EKS deploy via deploy/build.sh. Supports the CPLAT-style multi-step build (base image, cached on ECR, plus the main image). Parameterized USE_BUF, ENVIRONMENT, TIMEOUT, ATOMIC, BUILD_ARGS, REF_NAME.

Reusable workflows (.github/workflows/):

  • buf-push: Push protobufs to buf.build. When GENERATE_KEY_PROTOS is set, it also sets up Ruby and calls the Deimos Rake task to generate on-disk key protos for pushing.
  • database-schema-check: full schema-drift check. Requires Ruby. Note: a Rake task testing:unload_migrations is required for this to work properly.
  • deploy-comment: Allows to deploy to staging with a simple @deploy staging comment on any PR.

Composite actions (common/):
- common/slack: Slack notify that resolves the triggerer to a Slack @mention via email
- common/buf-generate: cache + buf generate (configurable cache path / template)
- common/deploy-staging: generic staging EKS deploy via deploy/build.sh; frontend build
  and delayed-jobs stripped; prepare-build gated on MULTI_STEP_BUILD; buf cache on USE_BUF;
  parameterized ENVIRONMENT/TIMEOUT/ATOMIC/BUILD_ARGS/REF_NAME

Reusable workflows (.github/workflows/):
- buf-push: Ruby set up only when GENERATE_KEY_PROTOS; breaking-against URL derived from repo
- database-schema-check: full schema-drift check; USE_BUF + SQL_MODE optional; documents the
  testing:unload_migrations rake task requirement
- deploy-comment: @Deploy PR-comment deploy via github/branch-deploy; composes the above;
  USE_BUF + MULTI_STEP_BUILD optional

Genericized from fadmin/store-admin; buf optional since vendors/ftp-sync don't use it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@dcbickfo dcbickfo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The reusable workflows force a flat structure under .github/workflows and we need to support multiple languages. With that in mind I don't beleive we should be putting the reusable workflows in this repo.

The bulk of the repo is composite actions that we can string together to form small workflows in our services. The workflows and the added actions also re-implement substantial portions of the existing ruby and common actions. I strongly suggest porting in the improvements.

with:
bundler-cache: true
env:
"BUNDLE_HTTPS://FLIPPLIB__JFROG__IO/FLIPPLIB/API/GEMS/FLIPP___GEMS/": ${{ secrets.BUNDLE_TOKEN }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks like it uses a different convention than the database-schema-check.yml. Are the : and / also valid for env?

Comment thread common/deploy-staging/action.yml Outdated
name: 'Deploy to Staging'
description: 'Deploy a service to a staging EKS environment via deploy/build.sh. Generic — frontend build and delayed-jobs are not included.'

inputs:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This has substantial overlap with the existing deploy/eks actions and uses the (now deprecated) way to authenticate with AWS. The deploy/eks action supports both OIDC and the legacy method. Can we fold whatever we're looking at here in instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yep, I can look at this!

Comment thread common/slack/action.yml
@@ -0,0 +1,141 @@
name: slack

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This has substantial overlap with slack but does add new features in a meaningful way, can we fold it in instead of re-writing it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I didn't want to risk breaking things - one annoying part of the way we have this set up is that we'd have to bump the version on everything to v1 if we introduce breaking changes. If you're not worried about backwards compatibility or people accidentally pulling in the new version, I can definitely just replace the existing one with this.

Comment thread common/buf-generate/action.yml Outdated
using: 'composite'
steps:
- name: Buf cache
uses: actions/cache@v4

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This pins to an older version of the cache action and follows a different idiom than the existing ruby/deps.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hmm... the point is that this is useful completely outside the scope of Ruby - i.e. it can be used for bare deploys which are language-agnostic. I'll update the cache though.

@dorner

dorner commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

The reusable workflows force a flat structure under .github/workflows and we need to support multiple languages. With that in mind I don't beleive we should be putting the reusable workflows in this repo.

Not sure I understand this comment. GitHub enforces all reusable workflows to be in a flat structure. I can rename them so the one that's Ruby-specific (the DB one) has "ruby" in the name maybe?

… versions

- Remove common/deploy-staging; add its functionality (USE_BUF cache restore,
  MULTI_STEP_BUILD prepare-build, BUILD_ARGS, REF_NAME + ref-aware checkout) to the
  existing deploy/eks action. deploy-comment now composes deploy/eks.
- Rename database-schema-check.yml -> ruby-database-schema-check.yml; switch its bundle
  auth from ARTIFACTORY_RUBY_TOKEN to the BUNDLE_TOKEN form used by buf-push.
- Bump actions/cache @v4 -> @v5 and actions/checkout @v4 -> @v6.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dorner

dorner commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

@dcbickfo made some changes, please take a look!

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