Skip to content

Commit

Permalink
ATO-762: [deploy] Removing unecessary service.
Browse files Browse the repository at this point in the history
  • Loading branch information
kalpaitch committed Jul 23, 2024
1 parent b8c6ba5 commit 1633dcb
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 95 deletions.
47 changes: 0 additions & 47 deletions .github/actions/build-backend-component/action.yml

This file was deleted.

74 changes: 48 additions & 26 deletions .github/workflows/deploy-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ permissions:

jobs:
build-frontend-dependencies:
if: contains(github.event.head_commit.message, '[deploy]') == true
# if: contains(github.event.head_commit.message, '[deploy]') == true
name: Build frontend
runs-on: ubuntu-latest
environment:
name: demo
outputs:
artifact-name: ${{ steps.build.outputs.artifact-id }}
steps:
Expand All @@ -36,15 +38,15 @@ jobs:
artifact-name: frontend-build-demo

push-frontend-image:
if: contains(github.event.head_commit.message, '[deploy]') == true
# if: contains(github.event.head_commit.message, '[deploy]') == true
name: Push frontend image
needs: build-frontend-dependencies
runs-on: ubuntu-latest
outputs:
image-uri: ${{ steps.push-image.outputs.image-uri }}
environment:
name: demo
url: ${{ steps.push-image.outputs.image-url }}
outputs:
image-uri: ${{ steps.push-image.outputs.image-uri }}
steps:
- name: Login to GDS Dev Dynatrace Container Registry
uses: docker/login-action@v3
Expand All @@ -61,19 +63,19 @@ jobs:
aws-role-arn: ${{ vars.DEPLOYMENT_ROLE_ARN }}
repository: ${{ vars.FRONTEND_CONTAINER_REPOSITORY_NAME }}
image-tags: "${{ github.head_ref || github.ref_name }}"
dockerfile: Dockerfile
dockerfile: infrastructure/frontend/Dockerfile
artifact-name: frontend-build-demo
artifact-path: dist

build-frontend-infrastructure:
if: contains(github.event.head_commit.message, '[deploy]') == true
# if: contains(github.event.head_commit.message, '[deploy]') == true
name: Build frontend infrastructure
needs: push-frontend-image
runs-on: ubuntu-latest
environment:
name: demo
outputs:
template: ${{ steps.replace-placeholders.outputs.template }}
environment:
name: development
steps:
- name: Pull repository
id: checkout
Expand Down Expand Up @@ -104,7 +106,7 @@ jobs:
path: .aws-sam/build

deploy-frontend:
if: contains(github.event.head_commit.message, '[deploy]') == true
# if: contains(github.event.head_commit.message, '[deploy]') == true
name: Deploy frontend
needs: [ build-frontend-infrastructure, deploy-api, deploy-cognito, deploy-dynamodb ]
runs-on: ubuntu-latest
Expand Down Expand Up @@ -156,10 +158,12 @@ jobs:
printf "🌐 Deployment URL\n%s" "$url" >> "$GITHUB_STEP_SUMMARY"
echo "url=$url" >> "$GITHUB_OUTPUT"
build-dynamo:
if: contains(github.event.head_commit.message, '[deploy]') == true
build-dynamodb:
# if: contains(github.event.head_commit.message, '[deploy]') == true
name: Build dynamodb
runs-on: ubuntu-latest
environment:
name: demo
outputs:
artifact-name: ${{ steps.build.outputs.artifact-name }}
cache-key: ${{ steps.build.outputs.cache-key }}
Expand All @@ -168,18 +172,21 @@ jobs:
id: build
uses: govuk-one-login/github-actions/sam/build-application@6144f39407b01c9b25b39537b3956deca9e32620 # 22/02/2024
with:
template: backend/dynamodb/cognito.template.yml
template: backend/dynamodb/dynamodb.template.yml
base-dir: backend/dynamodb
source-dir: backend/dynamodb
cache-name: dynamodb-infra
artifact-name: dynamodb-infrastructure
cache-name: backend-dynamodb-infra
artifact-name: backend-dynamodb-infrastructure
pull-repository: true

deploy-dynamodb:
if: contains(github.event.head_commit.message, '[deploy]') == true
# if: contains(github.event.head_commit.message, '[deploy]') == true
name: Deploy dynamodb
needs: build-dynamo
needs: build-dynamodb
runs-on: ubuntu-latest
environment:
name: demo
url: ${{ steps.deploy.outputs.stack-url }}
outputs:
stack-name: ${{ steps.build.outputs.stack-name }}
stack-url: ${{ steps.build.outputs.stack-url }}
Expand All @@ -202,6 +209,8 @@ jobs:
disable-rollback: false
stack-name-prefix: preview-dynamodb
artifact-name: ${{ needs.build-dynamodb.outputs.artifact-name }}
artifact-path: .aws-sam/build
template: .aws-sam/build/template.yaml
cache-name: ${{ needs.build-dynamodb.outputs.cache-key }}
s3-prefix: sse-preview
tags: |-
Expand All @@ -214,9 +223,11 @@ jobs:
DeploymentName=${{ steps.get-deployment-name.outputs.pretty-branch-name }}
build-cognito:
if: contains(github.event.head_commit.message, '[deploy]') == true
# if: contains(github.event.head_commit.message, '[deploy]') == true
name: Build cognito
runs-on: ubuntu-latest
environment:
name: demo
outputs:
artifact-name: ${{ steps.build.outputs.artifact-name }}
cache-key: ${{ steps.build.outputs.cache-key }}
Expand All @@ -229,15 +240,18 @@ jobs:
manifest: backend/cognito/package.json
base-dir: backend/cognito
source-dir: backend/cognito
cache-name: cognito-infra
artifact-name: cognito-infrastructure
cache-name: backend-cognito-infra
artifact-name: backend-cognito-infrastructure
pull-repository: true

deploy-cognito:
if: contains(github.event.head_commit.message, '[deploy]') == true
# if: contains(github.event.head_commit.message, '[deploy]') == true
name: Deploy cognito
needs: build-cognito
runs-on: ubuntu-latest
environment:
name: demo
url: ${{ steps.deploy.outputs.stack-url }}
outputs:
stack-name: ${{ steps.build.outputs.stack-name }}
stack-url: ${{ steps.build.outputs.stack-url }}
Expand All @@ -259,7 +273,9 @@ jobs:
delete-failed-stack: true
disable-rollback: false
stack-name-prefix: preview-cognito
artifact-name: backend-cognito-infrastructure
artifact-name: ${{ needs.build-cognito.outputs.artifact-name }}
artifact-path: .aws-sam/build
template: .aws-sam/build/template.yaml
cache-name: ${{ needs.build-cognito.outputs.cache-key }}
s3-prefix: sse-preview
tags: |-
Expand All @@ -272,9 +288,11 @@ jobs:
DeploymentName=${{ steps.get-deployment-name.outputs.pretty-branch-name }}
build-api:
if: contains(github.event.head_commit.message, '[deploy]') == true
# if: contains(github.event.head_commit.message, '[deploy]') == true
name: Build api
runs-on: ubuntu-latest
environment:
name: demo
outputs:
artifact-name: ${{ steps.build.outputs.artifact-name }}
cache-key: ${{ steps.build.outputs.cache-key }}
Expand All @@ -288,15 +306,18 @@ jobs:
base-dir: backend/api
source-dir: backend/api
additional-artifact-paths: backend/api/state-machines
cache-name: api-infra
artifact-name: api-infrastructure
cache-name: backend-api-infra
artifact-name: backend-api-infrastructure
pull-repository: true

deploy-api:
if: contains(github.event.head_commit.message, '[deploy]') == true
# if: contains(github.event.head_commit.message, '[deploy]') == true
name: Deploy api
needs: build-api
runs-on: ubuntu-latest
environment:
name: demo
url: ${{ steps.deploy.outputs.stack-url }}
outputs:
stack-name: ${{ steps.build.outputs.stack-name }}
stack-url: ${{ steps.build.outputs.stack-url }}
Expand All @@ -318,7 +339,8 @@ jobs:
delete-failed-stack: true
disable-rollback: false
stack-name-prefix: preview-api
artifact-name: backend-api-infrastructure
artifact-name: ${{ needs.build-api.outputs.artifact-name }}
template: .aws-sam/build/template.yaml
cache-name: ${{ needs.build-api.outputs.cache-key }}
s3-prefix: sse-preview
tags: |-
Expand Down
Loading

0 comments on commit 1633dcb

Please sign in to comment.