Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: remove automated deployment to staging from merge into main branch #438

Merged
merged 3 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/cdk-deploy/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Pre-Production - Test, and Deploy Workflow from Veda-Deploy
name: Test and Deploy Workflow

inputs:
env_aws_secret_name:
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: CDK Deploy Dev Workflow 🚀

permissions:
id-token: write
contents: read

on:
push:
branches:
- dev

jobs:
define-environment:
name: Set ✨ environment ✨
runs-on: ubuntu-latest
steps:
- name: Set the environment based on the branch
id: define_environment
run: |
if [ "${{ github.ref }}" = "refs/heads/dev" ]; then
echo "env_name=dev" >> $GITHUB_OUTPUT
fi
- name: Print the environment
run: echo "The environment is ${{ steps.define_environment.outputs.env_name }}"

outputs:
env_name: ${{ steps.define_environment.outputs.env_name }}

deploy:

name: Deploy to ${{ needs.define-environment.outputs.env_name }} 🚀
runs-on: ubuntu-latest
if: ${{ needs.define-environment.outputs.env_name }}
needs: [define-environment]
environment: ${{ needs.define-environment.outputs.env_name }}
concurrency: ${{ needs.define-environment.outputs.env_name }}

steps:
- name: Checkout
uses: actions/checkout@v4
with:
lfs: "true"
submodules: "false"

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.DEPLOYMENT_ROLE_ARN }}
role-session-name: "veda-backend-github-${{ needs.define-environment.outputs.env_name }}-deployment"
aws-region: us-west-2

- name: Run veda-backend deployment
uses: "./.github/actions/cdk-deploy"
with:
env_aws_secret_name: ${{ vars.ENV_AWS_SECRET_NAME }}
143 changes: 0 additions & 143 deletions .github/workflows/develop.yml

This file was deleted.

144 changes: 0 additions & 144 deletions .github/workflows/main.yml

This file was deleted.

4 changes: 1 addition & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,7 @@ jobs:

- name: Get environment configuration for target branch
run: |
if [ "${{ github.base_ref }}" == "main" ]; then
./scripts/get-env.sh "veda-backend-uah-staging-env"
elif [ "${{ github.base_ref }}" == "develop" ]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

if [ "${{ github.base_ref }}" == "develop" ]; then
./scripts/get-env.sh "veda-backend-uah-dev-env"
else
echo "No environment associated with ${GITHUB_REF##*/} branch. Test changes against dev stack"
Expand Down