Skip to content

Commit 68c0844

Browse files
committed
Added environment option on Action
1 parent 11b41a1 commit 68c0844

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

.github/workflows/deploy-prod.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,32 @@ on:
66
description: 'Are you sure you want to proceed? Type "yes" to confirm.'
77
required: true
88
default: 'no'
9-
9+
environment:
10+
description: 'Which environment do you want to deploy to?'
11+
options:
12+
- prod
13+
- pgvle
14+
1015
permissions:
1116
id-token: write
1217
contents: read
1318

1419
jobs:
20+
confirm-job:
21+
runs-on: ubuntu-latest
22+
environment: ProdApproval
23+
steps:
24+
- name: Check confirmation
25+
run: |
26+
if [ "${{ github.event.inputs.confirm }}" != "yes" ]; then
27+
echo "Confirmation failed. Exiting workflow."
28+
exit 1
29+
fi
30+
echo "Confirmation successful. Proceeding..."
31+
1532
build_and_push_docker_image:
1633
runs-on: ubuntu-latest
17-
environment: prod
34+
environment: ${{ github.event.inputs.environment }}
1835
name: Build and push learninghub moodle cron docker image
1936
env:
2037
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
@@ -48,7 +65,7 @@ jobs:
4865
deploy_learninghubmoodlecron_to_cluster:
4966
needs: build_and_push_docker_image
5067
runs-on: ubuntu-latest
51-
environment: prod
68+
environment: ${{ github.event.inputs.environment }}
5269
name: 'Deploy learninghub moodle cron to AKS cluster'
5370
env:
5471
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

0 commit comments

Comments
 (0)