Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add colourful Ansible output to GitHub example workflow #183

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions .github-deploy-prod.yml.sample
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# This example workflow can be used to perform manually-triggered Azimuth deployments targeting production environments.
# The workflow requires a GitHub environment (https://docs.github.com/en/actions/using-jobs/using-environments-for-jobs) to
# be created in the site-specific config repo with a name which exactly matches the azimuth-config environment to be used
# for production deployments. For security, this GitHub environment should also have a deployment protection rule which
# restricts the environment workflows to only run on the main/default branch. This ensures that production deployments
# be created in the site-specific config repo with a name which exactly matches the azimuth-config environment to be used
# for production deployments. For security, this GitHub environment should also have a deployment protection rule which
# restricts the environment workflows to only run on the main/default branch. This ensures that production deployments
# cannot be executed from arbitrary branches which could contain incorrect or unreviewed configuration.
#
# A manually-triggered workflow is used here since GitHub does not allow deployment approval rules for environments in
# A manually-triggered workflow is used here since GitHub does not allow deployment approval rules for environments in
# private GitHub repos without a GitHub Enterprise subscription. If the site-specific config repo is public, or if an enterprise
# subscription is available, then triggering the workflow on push to main with additional approval rules in the environment is
# subscription is available, then triggering the workflow on push to main with additional approval rules in the environment is
# the recommended approach.
#
#
# The site-specific config repo must also define a repository secret named GIT_CRYPT_KEY_B64 which contains the base64 encoded
# git-crypt key which was used to encrypt the repository's secrets. This can be obtained by running `git-crypt export-key - | base64`
# from within an unlocked checkout of the repository. For information on defining GitHub repo secrets, see:
Expand All @@ -18,7 +18,7 @@
name: Azimuth deployment
on:
workflow_dispatch:
inputs:
inputs:
environment:
description: "The Azimuth config environment to deploy"
type: environment
Expand All @@ -40,6 +40,8 @@ jobs:

- name: Deploy Azimuth
shell: bash
env:
ANSIBLE_FORCE_COLOR: True
# Here we just decrypt the repo checkout then follow the steps from the Azimuth deployment docs.
# The GitHub repo should have an environment configured with a name which matches the Azimuth config environment.
# This GitHub environment should also have a branch protection rule which only allows deployments on chosen production branch (e.g. main).
Expand Down
4 changes: 3 additions & 1 deletion .github-deploy-staging.yml.sample
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This example workflow can be adapted to perform automated Azimuth deployments targeting staging or test environments.
# The `azimuth-config-env-name` variable in the `env` section below should be set to name of the Azimuth config environment
# to be deployed.
#
#
# The site-specific config repo must also define a repository secret named GIT_CRYPT_KEY_B64 which contains the base64 encoded
# git-crypt key which was used to encrypt the repository's secrets. This can be obtained by running `git-crypt export-key - | base64`
# from within an unlocked checkout of the repository. For information on defining GitHub repo secrets, see:
Expand Down Expand Up @@ -30,6 +30,8 @@ jobs:

- name: Deploy Azimuth
shell: bash
env:
ANSIBLE_FORCE_COLOR: True
# Here we just decrypt the repo checkout then follow the steps from the Azimuth deployment docs.
run: |
set -e
Expand Down