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

Remove deploy-aws #415

Merged
merged 1 commit into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 3 additions & 33 deletions .github/workflows/copilot_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Deploy to AWS

permissions:
packages: write
contents: write

on:
workflow_dispatch:
Expand Down Expand Up @@ -30,38 +31,7 @@ env:

jobs:
docker-build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Docker metadata
id: metadata
uses: docker/metadata-action@v4
with:
images: ${{env.IMAGE_REPO_PATH}}/${{env.IMAGE_NAME}}
tags: |
type=sha,format=long
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
type=ref,event=branch

- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push docker image
uses: docker/build-push-action@v4
with:
context: .
tags: ${{ steps.metadata.outputs.tags}}
labels: ${{ steps.metadata.outputs.labels }}
push: true
file: ./fsd_config/Dockerfile
build-args: |
COMMIT_SHA=:${{ github.sha }}
uses: ./.github/workflows/dluhc-build-and-publish.yml

copilot_environments_workflow_setup:
runs-on: ubuntu-latest
Expand All @@ -80,7 +50,7 @@ jobs:

copilot_env_deploy:
concurrency:
group: "${{ github.workflow }} @ ${{ github.ref }}"
group: "fsd-preaward-copilot-individual"
cancel-in-progress: false
permissions:
id-token: write # This is required for requesting the JWT
Expand Down
66 changes: 11 additions & 55 deletions .github/workflows/dluhc-build-and-deploy-with-forms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,19 @@ on:
workflow_dispatch:
inputs:
environment:
description: Which AWS Account to use
description: Which AWS Account to use
type: choice
required: true
options:
- test
- uat
- test
- uat
default: test
copilot:
description: Whether to deploy to AWS?
type: boolean
required: false
default: false


env:
DOCKER_REGISTRY: ghcr.io
IMAGE_NAME: "runner"
Expand Down Expand Up @@ -111,10 +110,10 @@ jobs:
perf_test_target_url_application_store: https://funding-service-design-application-store-dev.london.cloudapps.digital
perf_test_target_url_fund_store: https://funding-service-design-fund-store-dev.london.cloudapps.digital
perf_test_target_url_assessment_store: https://funding-service-design-assessment-store-dev.london.cloudapps.digital
e2e_tests_target_url_frontend: https://fsd:fsd@frontend.dev.gids.dev # pragma: allowlist secret
e2e_tests_target_url_authenticator: https://fsd:fsd@authenticator2.dev.gids.dev # pragma: allowlist secret
e2e_tests_target_url_form_runner: https://fsd:fsd@forms.dev.gids.dev # pragma: allowlist secret
e2e_tests_target_url_assessment: https://fsd:fsd@assessment.dev.gids.dev # pragma: allowlist secret
e2e_tests_target_url_frontend: https://fsd:fsd@frontend.dev.gids.dev # pragma: allowlist secret
e2e_tests_target_url_authenticator: https://fsd:fsd@authenticator2.dev.gids.dev # pragma: allowlist secret
e2e_tests_target_url_form_runner: https://fsd:fsd@forms.dev.gids.dev # pragma: allowlist secret
e2e_tests_target_url_assessment: https://fsd:fsd@assessment.dev.gids.dev # pragma: allowlist secret
run_performance_tests: true
run_e2e_tests: false
secrets:
Expand Down Expand Up @@ -148,55 +147,12 @@ jobs:
perf_test_target_url_application_store: https://funding-service-design-application-store-test.london.cloudapps.digital
perf_test_target_url_fund_store: https://funding-service-design-fund-store-test.london.cloudapps.digital
perf_test_target_url_assessment_store: https://funding-service-design-assessment-store-test.london.cloudapps.digital
e2e_tests_target_url_frontend: https://fsd:fsd@frontend.test.gids.dev # pragma: allowlist secret
e2e_tests_target_url_authenticator: https://fsd:fsd@authenticator2.test.gids.dev # pragma: allowlist secret
e2e_tests_target_url_form_runner: https://fsd:fsd@forms.test.gids.dev # pragma: allowlist secret
e2e_tests_target_url_assessment: https://fsd:fsd@assessment.test.gids.dev # pragma: allowlist secret
e2e_tests_target_url_frontend: https://fsd:fsd@frontend.test.gids.dev # pragma: allowlist secret
e2e_tests_target_url_authenticator: https://fsd:fsd@authenticator2.test.gids.dev # pragma: allowlist secret
e2e_tests_target_url_form_runner: https://fsd:fsd@forms.test.gids.dev # pragma: allowlist secret
e2e_tests_target_url_assessment: https://fsd:fsd@assessment.test.gids.dev # pragma: allowlist secret
run_performance_tests: true
run_e2e_tests: true
secrets:
FSD_GH_APP_ID: ${{ secrets.FSD_GH_APP_ID }}
FSD_GH_APP_KEY: ${{ secrets.FSD_GH_APP_KEY }}

deploy-aws:
if: ${{ github.event.inputs.copilot != 'false' }}
needs: docker-build
concurrency: deploy-${{ 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: FORMS_COPILOT_${{ 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/fsd-form-runner/manifest.yml

- name: Inject replacement image into manifest
run: |
yq -i '.image.location = "${{env.IMAGE_REPO_PATH}}/${{env.IMAGE_NAME}}:sha-${{ github.sha }}"' copilot/fsd-form-runner/manifest.yml

# - name: Run database migrations
# run: scripts/migration-task-script.py ${{ inputs.environment || 'test' }}

- name: Copilot deploy
run: |
copilot deploy --env ${{ inputs.environment || 'test' }}
1 change: 1 addition & 0 deletions .github/workflows/dluhc-build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
".github/workflows/increment-version.yml",
"version",
]
workflow_call:

env:
IMAGE_NAME_STUB: "digital-form-builder-dluhc-"
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION=0.1.208
VERSION=0.1.209