GitHub Workflows
General Remarks
The two official branches are main and production.
All workflow definition files are located in .github/workflows.
Conceptually, the workflows use the cli commands from pnpm cli located in the
scripts folder. That way, you can still run all functionality
locally in cases where you cannot use GitHub.
Development Flow
When a change is made to the Central CDN's source code, then these are the steps to go through:
- Open a development branch, taken from
main. - Make your changes.
- Create a pull request and verify that all checks succeed.
- this will spin up a development environment in the
stageAWS account. In order to keep it (it will be destroyed by default), add the Github Labelkeep-deploy. - Get the approval for your PR.
- Merge the PR back to
mainand verify that the CICD workflow succeeds. - Your changes are now available in the
stageenvironment.
It is a separate decision by the maintainers of the Central CDN to take the
changes to prod. For that, the current state of the main branch is manually
merged to the production branch. That merge triggers the CICD workflow again,
this time for the account type prod. Also it will be automerged every day with
all commits older than 24h.
CICD (cicd.yaml)
This is the main workflow file. It defines the deployment of stage and prod.
There are several ways how the deployment can be triggered:
- By a merge to
mainorproduction. This (re-)deploys the respective environment, i.e,stageorprod. - By a deployment trigger. Whenever an origin param is added or changed, the
deployment trigger Lambda function triggers this workflow. The payload of
that trigger request contains the information whether to run the workflow for
stageorprod. - By a manual event. You can open the
workflow page in GitHub
in a browser, click the 'Run workflow' button, click the next, green 'Run
workflow' button and thereby run a deployment for
stage. This is not intended forprodor anydevenvironment.
The logic which account type (stage or prod) to use based on the incoming
event and the available input data is implemented in the job set-account-type.
The cicd.yaml file also defines to run checks with every pull request on
main. These checks include formatting, linting, and some tests around the
deployed AWS resources.
Release
This workflow creates a new prod version.
It is manually triggered and merges the current state of the main branch to
the production branch. This triggers the CICD workflow to deploy the state
of the production branch to the prod environment.
Check Config (check-config.yaml)
Whenever one of the JSON files in the directory origin-config is created,
updated, or deleted, this workflow is run.
It tests whether or not the content of the JSON files is valid and also checks if the given AWS account IDs make sense by temporarily deploying (and destroying) test roles.
Restore central CDN config
See Backup and Recovery for more details.
Invalidate CDN cache
A possibility to manually invalidate the CDN's cache.