GitOps releases
Sync staging with main
The best way to maintain a staging environment is by syncing it with your
mainline git branch - every time a change is made to main
, trigger a deploy to
staging. Whether through direct pushes or successful pull requests, this will
ensure that the staging environment always mirrors the main
branch of your
repo.
The workflows below will first create a new latest
tag of your component in
Architects registry. Then it will trigger architect deploy
to ship that
component and its changes to an existing staging
environment. This environment
is not created by this workflow since it is intended to be persistent, so you’ll
have to create the environment in advance.
ARCHITECT_PASSWORD
must be a personal access
token.
Github actions
Cut releases for production
The last step of your GitOps workflow is to finally get your code into
production! If you want, you’re welcome to use the workflow described previously
to automatically deploy from main
straight to production, but in this workflow
we’ll show how to trigger the deployment on a manual release cut. By triggering
on new releases, we can log a version history of all the code that made its way
to production to make it easier to instrument rollbacks.
The workflows below will first register the component with a tag matching the
name of the new release. Then they will deploy the new component tag to an
environment named production
. Obviously production is intended to be
persistent, so you’ll have to create the environment in advance.
ARCHITECT_PASSWORD
must be a personal access
token.
Github actions
Configurable workflows
Architect can automatically generate GitHub workflows to coordinate component
deployments throughout the entire development lifecycle. These deployment types
include deployments to preview environments, deployments based on merging to a
specific branch such as main
, or deployments to production. If your component
is connected to GitHub already, these workflows can be configured on the
component settings page. If your component hasn’t yet been connected to GitHub,
that can be done by selecting the “Connect repo” button, then following the
prompts. The button is at the top of a component page like in the following
image.
The following workflows expect that GitHub secrets ARCHITECT_EMAIL and ARCHITECT_PASSWORD exist in your component’s connected repo. The password is an Architect access token and can be generated on your access tokens page.
Preview environments
The following workflow deploys a component preview environment: a temporary deployment of a specific component that is spun up when a pull request is opened. The deployment will occur on the cluster and the account name specified in the GitHub workflow file.
A preview environment will be deployed during the following events:
- A pull request is opened
- A pull request has new code pushed to the repo
- A pull is re-opened
The deployment will be torn down after the pull request is closed.
Below is an example of a preview environment workflow that Architect will generate for a component.
Branch deployments
Branch deployments will deploy a component when code is pushed to a specific
branch. A branch deployment could be used to set up user acceptance testing
environments that will create deployments when new features are pushed to main
or another specific branch. Like preview environments, the deployment will be
created in the specific environment and account specified in the file.
The example below is configured to deploy a component to the Architect
environment <environment-name>
of the account <account-name>
when code is
pushed to the main
branch on GitHub.
Release deployments
Release deployments are set up to deploy a component when a release is published in the connected GitHub repo. This can be used to support production environments by creating new deployments when releases occur.
The below workflow shows an example that will deploy the component to the
environment <environment-name>
of the account <account-name>
when a release
is published in the connected GitHub repo.