Skip to content

Commit ad5d5e5

Browse files
authored
ci: remove automated deployment to staging from merge into main branch (#438)
### Issue NASA-IMPACT/veda-deploy#52 ### What? - This PR removes the github workflow that deploys to the staging environment and the pre-deploy cdk diff for the staging environment because it is now managed in veda-deploy. - This PR modifies the automated dev branch and instance deployment to use the same cdk-deploy/action that is used in veda-deploy
2 parents 96f2830 + 65a74da commit ad5d5e5

File tree

5 files changed

+57
-291
lines changed

5 files changed

+57
-291
lines changed

.github/actions/cdk-deploy/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Pre-Production - Test, and Deploy Workflow from Veda-Deploy
1+
name: Test and Deploy Workflow
22

33
inputs:
44
env_aws_secret_name:

.github/workflows/cicd.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: CDK Deploy Dev Workflow 🚀
2+
3+
permissions:
4+
id-token: write
5+
contents: read
6+
7+
on:
8+
push:
9+
branches:
10+
- dev
11+
12+
jobs:
13+
define-environment:
14+
name: Set ✨ environment ✨
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Set the environment based on the branch
18+
id: define_environment
19+
run: |
20+
if [ "${{ github.ref }}" = "refs/heads/dev" ]; then
21+
echo "env_name=dev" >> $GITHUB_OUTPUT
22+
fi
23+
- name: Print the environment
24+
run: echo "The environment is ${{ steps.define_environment.outputs.env_name }}"
25+
26+
outputs:
27+
env_name: ${{ steps.define_environment.outputs.env_name }}
28+
29+
deploy:
30+
31+
name: Deploy to ${{ needs.define-environment.outputs.env_name }} 🚀
32+
runs-on: ubuntu-latest
33+
if: ${{ needs.define-environment.outputs.env_name }}
34+
needs: [define-environment]
35+
environment: ${{ needs.define-environment.outputs.env_name }}
36+
concurrency: ${{ needs.define-environment.outputs.env_name }}
37+
38+
steps:
39+
- name: Checkout
40+
uses: actions/checkout@v4
41+
with:
42+
lfs: "true"
43+
submodules: "false"
44+
45+
- name: Configure AWS Credentials
46+
uses: aws-actions/configure-aws-credentials@v4
47+
with:
48+
role-to-assume: ${{ secrets.DEPLOYMENT_ROLE_ARN }}
49+
role-session-name: "veda-backend-github-${{ needs.define-environment.outputs.env_name }}-deployment"
50+
aws-region: us-west-2
51+
52+
- name: Run veda-backend deployment
53+
uses: "./.github/actions/cdk-deploy"
54+
with:
55+
env_aws_secret_name: ${{ vars.ENV_AWS_SECRET_NAME }}

.github/workflows/develop.yml

Lines changed: 0 additions & 143 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 0 additions & 144 deletions
This file was deleted.

.github/workflows/pr.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,7 @@ jobs:
136136
137137
- name: Get environment configuration for target branch
138138
run: |
139-
if [ "${{ github.base_ref }}" == "main" ]; then
140-
./scripts/get-env.sh "veda-backend-uah-staging-env"
141-
elif [ "${{ github.base_ref }}" == "develop" ]; then
139+
if [ "${{ github.base_ref }}" == "develop" ]; then
142140
./scripts/get-env.sh "veda-backend-uah-dev-env"
143141
else
144142
echo "No environment associated with ${GITHUB_REF##*/} branch. Test changes against dev stack"

0 commit comments

Comments
 (0)