Skip to content

Commit da9c95a

Browse files
committed
feature: add deploy job for Staging API env
1 parent e38df59 commit da9c95a

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

.github/workflows/deploy.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ on:
88
workflow_dispatch:
99
inputs:
1010
environment:
11-
description: 'Environment (Production or Staging)'
11+
description: 'Environment (Production, Staging or Staging API)'
1212
required: true
1313
type: choice
1414
options:
1515
- Production
1616
- Staging
17+
- Staging API
18+
1719
jobs:
1820
setup:
1921
runs-on: ubuntu-latest
@@ -54,3 +56,13 @@ jobs:
5456
VAULT_APPROLE_ROLE_ID: ${{ secrets.VAULT_APPROLE_ROLE_ID }}
5557
VAULT_APPROLE_SECRET_ID: ${{ secrets.VAULT_APPROLE_SECRET_ID }}
5658
CHARMHUB_TOKEN: ${{ secrets.CHARMHUB_TOKEN }}
59+
60+
deploy-staging-api-env-on-merge-into-main:
61+
# this job can only run when invoked by CI because of a merge into main
62+
if: ${{ github.event.inputs.environment == '' && github.ref == 'refs/heads/main' }}
63+
# we will dispatch another copy of this workflow to deploy the Staging API env; we invoke the workflow
64+
# with an input, so `github.event.inputs.environment` won't be "" and the `if` condition above will be
65+
# false, thus there won't be a recursive loop
66+
uses: canonical/snapcraft.io/.github/workflows/deploy.yaml@main
67+
with:
68+
environment: Staging API

0 commit comments

Comments
 (0)