Skip to content

Commit 4bd6451

Browse files
authored
Adjust the workflow to the new deployment way (#4)
1 parent 6379dad commit 4bd6451

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Manually trigger deploy to staging or production
2+
run-name: "Manually deploy ${{ github.ref_name }} triggered by ${{ github.actor }}; version: ${{ inputs.version }}"
3+
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
version:
8+
description: "Enter the version number"
9+
required: true
10+
default: "main"
11+
environment:
12+
required: false
13+
description: "Select the environment to deploy to"
14+
type: choice
15+
options:
16+
- production
17+
default: production
18+
19+
permissions:
20+
id-token: write
21+
contents: read
22+
23+
jobs:
24+
trigger-production-deploy:
25+
runs-on: ubuntu-latest
26+
environment: production-fidl
27+
if: ${{ github.ref_name == 'main' && inputs.version != '' && inputs.environment == 'production' }}
28+
steps:
29+
- name: Trigger production deploy
30+
uses: neti-filplus-infra/filplus-deploy-action@main
31+
with:
32+
version: ${{ inputs.version }}
33+
environment: production
34+
ecr-repository: provider-sample-url-finder-frontend
35+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_IMAGE_DEPLOYER }}
36+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_IMAGE_DEPLOYER }}
37+
aws-region: us-east-1

.github/workflows/publish-new-build.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ on:
1313
description: "Enter the version number"
1414
required: true
1515
default: "latest"
16+
deploy-to-production:
17+
description: "Deploy the new version on production?"
18+
required: false
19+
type: boolean
20+
default: false
1621

1722
permissions:
1823
contents: write
@@ -116,3 +121,22 @@ jobs:
116121
TAG_NAME="v${{ inputs.version }}"
117122
git tag $TAG_NAME
118123
git push origin $TAG_NAME
124+
125+
trigger-production-deploy:
126+
runs-on: ubuntu-latest
127+
environment: production-fidl
128+
needs:
129+
- code-check
130+
- bump-version
131+
- production-publish
132+
if: ${{ github.ref_name == 'main' && inputs.version != '' && inputs.deploy-to-production == true }}
133+
steps:
134+
- name: Trigger production deploy
135+
uses: neti-filplus-infra/filplus-deploy-action@main
136+
with:
137+
version: ${{ inputs.version }}
138+
environment: production
139+
ecr-repository: provider-sample-url-finder-frontend
140+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_IMAGE_DEPLOYER }}
141+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_IMAGE_DEPLOYER }}
142+
aws-region: us-east-1

0 commit comments

Comments
 (0)