Test deployment to dev environment with review updates #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | ||
workflow_call: | ||
inputs: | ||
environment: | ||
required: false | ||
type: string | ||
default: "dev" | ||
core_app: | ||
required: false | ||
type: string | ||
description: "Core app name" | ||
default: "core_app_name" | ||
jobs: | ||
set-env-variable: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
ACCOUNT_NUMBER: ${{ steps.set-env-var.outputs.ACCOUNT_NUMBER }} | ||
APP_NAME: ${{ steps.set-env-var.outputs.APP_NAME }} | ||
CLUSTER_NAME: ${{ steps.set-env-var.outputs.CLUSTER_NAME }} | ||
DOCKER_BUILD_PARAMS: ${{ steps.set-env-var.outputs.DOCKER_BUILD_PARAMS }} | ||
steps: | ||
- name: Checkout Code Repository | ||
uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
- name: Install pipenv | ||
run: pip install pipenv | ||
- name: Build Site | ||
run: | | ||
# python build_branches.py '*${{ inputs.environment }}*' | ||
python build_branches.py '*kmurphy*' | ||
- name: Set Environment Variable | ||
id: set-env-var | ||
run: | | ||
if [ "${{ inputs.environment }}" == "dev" ]; then | ||
echo "ACCOUNT_NUMBER=058264511034" >> $GITHUB_OUTPUT | ||
echo "APP_NAME=${{ inputs.core_app }}-dev" >> $GITHUB_OUTPUT | ||
echo "CLUSTER_NAME=frontend-dev-ecs-cluster" >> $GITHUB_OUTPUT | ||
elif [ "${{ inputs.environment }}" == "staging" ]; then | ||
echo "ACCOUNT_NUMBER=070528468658" >> $GITHUB_OUTPUT | ||
echo "APP_NAME=${{ inputs.core_app }}-staging" >> $GITHUB_OUTPUT | ||
echo "CLUSTER_NAME=frontend-staging-ecs-cluster" >> $GITHUB_OUTPUT | ||
fi | ||
deploy: | ||
uses: 0xPolygon/pipelines/.github/workflows/ecs_deploy_docker_taskdef.yaml@main | ||
needs: set-env-variable | ||
with: | ||
app_name: ${{ needs.set-env-variable.outputs.APP_NAME }} | ||
taskdef_file_vars: .github/assets/${{ inputs.environment }}-taskdef.yaml | ||
aws_region: eu-west-1 | ||
environment: ${{ inputs.environment }} | ||
cluster_name: ${{ needs.set-env-variable.outputs.CLUSTER_NAME }} | ||
account_number: "${{ needs.set-env-variable.outputs.ACCOUNT_NUMBER }}" | ||
docker_file: Dockerfile.review | ||
secrets: inherit |