Skip to content

Removing production environment #29

Removing production environment

Removing production environment #29

name: Update the post-award copilot environment
on:
workflow_dispatch:
inputs:
environment:
description: Which AWS Account to use?
type: choice
required: true
options:
- dev
- test
- uat
- production
push:
paths: # Ignore README markdown and only deploy when something in the post-award folder has changed
- 'apps/post-award/**'
- '!**/README.md'
branches: # Only run this workflow on pushes to the main branch
- main
pull_request:
types:
- closed # Further protection - only allow this workflow to run automatically on closed pull requests
jobs:
copilot_build:
concurrency: deploy-copilot-env-${{ inputs.environment || 'test' }}
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
runs-on: ubuntu-latest
environment: ${{ inputs.environment || 'test' }}
steps:
- name: Git clone the repository
uses: actions/checkout@v3
- name: Get current date
id: currentdatetime
run: echo "datetime=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT }}:role/GithubCopilotDeploy
role-session-name: COPILOT_ENV_POSTAWARD_${{ steps.currentdatetime.outputs.datetime }}
aws-region: eu-west-2
- name: Install AWS Copilot CLI
run: |
curl -Lo aws-copilot https://github.com/aws/copilot-cli/releases/latest/download/copilot-linux && chmod +x aws-copilot && sudo mv aws-copilot /usr/local/bin/copilot
- name: Copilot deploy
working-directory: 'apps/post-award'
run: |
copilot env deploy --name ${{ inputs.environment || 'test' }} --app post-award