Skip to content

Commit

Permalink
add mono repo deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
smohiudd committed Dec 14, 2023
1 parent 7dc6f06 commit c55f37e
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/actions/terraform-deploy/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Deploy

inputs:
env_aws_secret_name:
required: true
type: string
env-file:
type: string
default: ".env"
dir:
required: false
type: string
default: "."
script_path:
type: string
backend_stack_name:
type: string

runs:
using: "composite"

steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "pip"

- name: Install python dependencies
shell: bash
working-directory: ${{ inputs.dir }}
run: pip install -r deploy_requirements.txt

- name: Get relevant environment configuration from aws secrets
shell: bash
working-directory: ${{ inputs.dir }}
env:
SECRET_SSM_NAME: ${{ inputs.env_aws_secret_name }}
AWS_DEFAULT_REGION: us-west-2
run: |
if [[ -z "${{ inputs.script_path }}" ]]; then
./scripts/sync-env.sh ${{ inputs.env_aws_secret_name }}
else
python ${{ inputs.script_path }} --secret-id ${{ inputs.env_aws_secret_name }} --stack-names ${{ inputs.backend_stack_name}}
source .env
echo "PREFIX=data-pipeline-$STAGE" >> ${{ inputs.env-file }}
fi
- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
with:
terraform_version: 1.3.3

- name: Deploy
shell: bash
working-directory: ${{ inputs.dir }}
run: |
./scripts/deploy.sh ${{ inputs.env-file }} <<< init
./scripts/deploy.sh ${{ inputs.env-file }} <<< deploy

0 comments on commit c55f37e

Please sign in to comment.