Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

Merge pull request #45 from communitiesuk/dependabot/pip/cryptography… #54

Merge pull request #45 from communitiesuk/dependabot/pip/cryptography…

Merge pull request #45 from communitiesuk/dependabot/pip/cryptography… #54

Workflow file for this run

name: push to AWS
concurrency: deploy
on:
push:
branches:
- main
workflow_dispatch:
inputs:
environment:
description: Which AWS Account to use
type: choice
required: true
options:
- test
- production
jobs:
deployment:
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: Build static assets
run: |
./build.sh
- name: Get current date
id: currentdatetime
run: echo "::set-output name=datetime::$(date +'%Y%m%d%H%M%S')"
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_NUMBER }}:role/GitHubPushToECR
role-session-name: POST_AWARD_DATA_FRONTEND_${{ 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: Inject Git SHA into manifest
run: |
yq -i '.variables.GITHUB_SHA = "${{ github.sha }}"' copilot/data-frontend/manifest.yml
- name: Copilot deploy
run: |
copilot deploy --env ${{ inputs.environment || 'test' }}