This is the demo repository associated with the blog post "Multi-clouds deployment with OIDC and rollback support" .
Create your own repository from this one by clicking the Use this template
button on the top right of this page, and follow the quickstart below.
⚠️ As explained in the blog post, this is for fun and experiment only, and not for production!
In a scenario where multiple developers would collaborate on this repo, it is advised to protect the main
branch by setting up some branch protection rules. For instance:
- Go to
Settings
>Branches
; - Click on the
Add Rules
button; - Set
main
(or the name of your main, production branch) as the branch name pattern; - Choose the protection you want (e.g
Require a pull request before merging
with n reviewers).
See more information regarding branch protection rules here.
Create a tag protection rule that will protect the creation of tags matching the v*
pattern:
- Go to
Settings
>Tags
; - Click on the
Add Rules
button; - Set
v*
as the tag name pattern;
See more information regarding tag protection rules here.
Create three environments named aws
, azure
and gcp
, that will be used for the three cloud providers within the Actions workflows:
- Go to
Settings
>Environments
; - Click on the
New environment
button; - Set the name of the environment to
aws
(resp.azure
andgcp
); - Click on the
Configure environment
button; - Optionally, set the
Environment protection rules
toRequired reviewers
with the number of required reviewers according to your needs.
See more information regarding environments here.
See Environment setup.
See Cloud infrastructure setup.
See OIDC setup.
You should have a look at how the three reusable workflows are called and read the various comments to adapte the parameters to your needs.
As a repository admin, you can trigger the "🚀 Multi-cloud deployment demo" workflow:
- by creating a release with a tag matching the
v*
pattern; - manually on a tag matching the
v*
pattern.
If you get a 403 error when trying to access the Cloud run service, you might want to allow all users to invoke the service. To do so, run the following command:
#
# note: here "spring-petclinic" is the name of the service that will
# be created by the GitHub Actions workflow (see ../../.github/workflows/multi-cloud-deployment.yml#169)
#
$ gcloud run services add-iam-policy-binding spring-petclinic \
--member="allUsers" \
--role="roles/run.invoker" \
--region="$GCP_REGION"