Skip to content

Commit 0fbf6de

Browse files
committed
Add manual deploy workflow
1 parent 402ae6e commit 0fbf6de

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Manual deploy
2+
concurrency: build_and_deploy_v2_${{ github.ref_name }} # ensures that the job waits for any deployments triggered by the build workflow to finish
3+
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
environment:
8+
description: Environment to deploy to
9+
required: true
10+
type: choice
11+
default: qa
12+
options:
13+
- qa
14+
- staging
15+
- production
16+
image_tag:
17+
description: Docker image tag to be deployed
18+
required: true
19+
pull_request:
20+
types:
21+
- labeled
22+
- synchronize
23+
- reopened
24+
25+
permissions:
26+
id-token: write
27+
pull-requests: write
28+
29+
jobs:
30+
deploy:
31+
name: ${{ github.event.inputs.environment }} deployment
32+
runs-on: ubuntu-latest
33+
environment:
34+
name: ${{ github.event.inputs.environment }}
35+
url: ${{ steps.deploy_app_v2.outputs.deploy-url }}
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@v4
39+
40+
- name: Configure AWS credentials
41+
uses: aws-actions/configure-aws-credentials@v4
42+
with:
43+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
44+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
45+
aws-region: eu-west-2
46+
role-to-assume: Deployments
47+
role-duration-seconds: 3600
48+
role-skip-session-tagging: true
49+
50+
- name: Get secrets from AWS ParameterStore
51+
uses: dkershner6/aws-ssm-getparameters-action@v2
52+
with:
53+
parameterPairs: "/teaching-vacancies/github_action/infra/slack_webhook = SLACK_WEBHOOK"
54+
55+
- name: Deploy App to ${{ github.event.inputs.environment }}
56+
id: deploy_app_v2
57+
uses: ./.github/actions/deploy/
58+
with:
59+
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
60+
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
61+
azure-subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
62+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
63+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
64+
environment: ${{ github.event.inputs.environment }}
65+
tag: ${{ github.event.inputs.image_tag }}

0 commit comments

Comments
 (0)