This repo is deprecated in favor of the private github_actions repo. Please refer to the documentation therein. All development should now be forked from that repo.
This repository holds reusable Github Action workflows as well as example callers.
Inputs and secrets can be passed in from the caller to be used by the called
(i.e. reusable) workflow. You can see what inputs and secrets are used by the
reusable workflow by looking under its on.workflow_call
section.
The full workflow for a Rails app involves both CI and CD jobs, where CI involves tests and static analyses and CD involves deployments. Your client app can call the full workflow by including this line in your workflow file:
uses: tedconf/github_actions_public/.github/workflows/rails.yml@{git ref}
The variable {git ref}
can refer to a SHA, tag, or branch name.
This workflow runs two workflows in parallel:
- rails_ci_static_analyses
- rails_ci_tests
It is also meant to handle and/or install certain system dependencies through the setup-ruby and install-ruby-dependency-action composite actions, although these dependencies need to be added manually and specific requirements might be missing.
One requirement that is currently supported and also warrants highlighting is the suite of coyote integration tests, which need an Elasticsearch docker container to pass. This workflow both detects if coyote tests need to be run and if so, sets up ES automatically for you.
Currently this workflow deploys to staging whenever master
or main
are updated.
Future features include:
- Production deployments
- Feature branch teardown
If your repo is not a full Rails application and is instead a Ruby Gem, you
can use the rails_ci
workflow instead:
uses: tedconf/github_actions_public/.github/workflows/rails_ci.yml@{git ref}
If the testing process succeeds, the current rails workflow will automatically
deploy to staging environments when a branch is merged into the trunk, but if
you want to deploy a feature branch to staging as well, just include the string
fbranch
anywhere in the branch name and the workflow will pick it up and
deploy it.
- Create a workflow file under
.github/workflows/
and call the reusable workflow. git rm Jenkinsfile
git mv config/secrets.jenkins.yml config/secrets.github.yml
. You'll also need to change the MySQL/database root password toroot
, as the OS for our runners (currently Ubuntu) do not allow a blank password for the root user.