Skip to content

Deploy to prod by @alismx #66

Deploy to prod by @alismx

Deploy to prod by @alismx #66

Workflow file for this run

name: Deploy
run-name: Deploy to ${{ inputs.workspace }} by @${{ github.actor }}
on:
workflow_dispatch:
inputs:
workspace:
description: 'The workspace to deploy to'
required: true
type: choice
options:
- ""
- prod
concurrency:
group: ${{ github.event.inputs.workspace }}-deploy
cancel-in-progress: false
permissions:
id-token: write
contents: read
env:
workspace: ${{ github.event.inputs.workspace }}
jobs:
terraform:
name: Run Terraform
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: ./terraform/implementation/ecs
steps:
- name: Check Out Changes
uses: actions/checkout@v4
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
role-session-name: githubDeploymentWorkflow
aws-region: ${{ secrets.AWS_REGION }}
- name: Terraform
env:
WORKSPACE: ${{ env.workspace }}
BUCKET: ${{ secrets.TFSTATE_BUCKET }}
DYNAMODB_TABLE: ${{ secrets.TFSTATE_DYNAMODB_TABLE }}
REGION: ${{ secrets.AWS_REGION }}
OWNER: ${{ vars.OWNER }}
PROJECT: ${{ vars.PROJECT }}
shell: bash
run: |
echo "WORKSPACE=$WORKSPACE" >> .env
echo "BUCKET=$BUCKET" >> .env
echo "DYNAMODB_TABLE=$DYNAMODB_TABLE" >> .env
echo "REGION=$REGION" >> .env
echo "owner = \"$OWNER\"" >> $WORKSPACE.tfvars
echo "project = \"$PROJECT\"" >> $WORKSPACE.tfvars
echo "region = \"$REGION\"" >> $WORKSPACE.tfvars
./deploy.sh -e $WORKSPACE --ci