Skip to content

Update the pre-award copilot environment #213

Update the pre-award copilot environment

Update the pre-award copilot environment #213

name: Update the pre-award copilot environment
on:
workflow_dispatch:
inputs:
environment:
description: Which AWS Account to use?
type: choice
required: true
options:
- dev
- test
- uat
- prod
push:
paths: # Ignore README markdown and only deploy when something in the pre-award folder has changed
- 'apps/pre-award/**'
- '!**/README.md'
branches: # Only run this workflow on pushes to the main branch
- main
jobs:
copilot_environments_workflow_setup:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.copilot_env_matrix.outputs.env_list }}
steps:
- id: copilot_env_matrix
run: |
if [ "${{ inputs.environment }}" != '' ]; then
echo "env_list=[\"${{ inputs.environment }}\"]" >> "$GITHUB_OUTPUT"
else
echo "env_list=[\"dev\", \"test\", \"uat\", \"prod\"]" >> $GITHUB_OUTPUT
fi
copilot_env_build:
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
needs: [ copilot_environments_workflow_setup ]
runs-on: ubuntu-latest
strategy:
matrix:
value: ${{fromJSON(needs.copilot_environments_workflow_setup.outputs.matrix)}}
environment: ${{ matrix.value }}
steps:
- name: Git clone the repository
uses: actions/checkout@v4
- name: Setup Copilot
uses: ./.github/actions/copilot_setup
with:
copilot_environment: ${{ matrix.value }}
AWS_ACCOUNT: ${{ secrets.AWS_ACCOUNT }}
- name: Copilot deploy
working-directory: 'apps/pre-award'
run: |
copilot env deploy --name ${{ matrix.value }} --app pre-award