Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spike/psp 6928 #4298

Draft
wants to merge 19 commits into
base: dev
Choose a base branch
from
Draft
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
85 changes: 85 additions & 0 deletions .github/workflows/aws.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Demo - Application deploymennt2

on:
workflow_dispatch:
inputs:
name:
description: 'lalala'
default: 'fii'
required: true

env:
MY_PROD_SECRET: ${{ secrets.LE_SECRET }} # set this to your preferred AWS region, e.g. us-west-1


permissions:
contents: read

jobs:
build-api:
name: Build Backend app
runs-on: ubuntu-latest

steps:
- name: build pims-api
run: echo "Builing app"
- name: store image
run: echo "storing app image"

build-frontend:
name: Build Frontend
runs-on: ubuntu-latest

steps:
- name: Build Frontend app
run: echo "bBuilding frontendapp"
- name: TEST Secrety
run: echo "storing frontend image"

deploy-dev:
name: Deploy to Dev
runs-on: ubuntu-latest
needs: [build-api, build-frontend]
environment: dev

steps:
- name: Deploying frontend to dev
run: echo "deploying to dev"
- name: Deploting backend to dev
run: echo "Deploying bakend to dev"

deploy-test:
name: Deploy to Test
runs-on: ubuntu-latest
needs: [deploy-dev]
environment: test

steps:
- name: Deploying frontend to test
run: echo "deploying to test"
- name: Deploting backend to test
run: echo "Deploying bakend to test"

deploy-uat:
name: Deploy to UAT
runs-on: ubuntu-latest
needs: [deploy-test]
environment: uat

steps:
- name: Deploying frontend to UAT
run: echo "deploying to uat"
- name: Deploting backend to uat
run: echo "Deploying bakend to uat"

deploy-prod:
name: Deploy to Production
runs-on: ubuntu-latest
needs: [deploy-uat]
environment: production

steps:
- name: Deploying frontend to Production
run: echo "deploying to prod"
- name: Deploting backend to prod
run: echo "Deploying bakend to prod"
48 changes: 48 additions & 0 deletions .github/workflows/demo-db-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

name: Deploy Database

on:
workflow_call:
inputs:
domain:
description: 'Domain to deploy the database'
required: true
type: string


permissions:
contents: read

jobs:
deploy-frontend:
name: Frontend
runs-on: ubuntu-latest
environment: ${{inputs.domain}}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stops the execution if the environment has approvals required


steps:
- name: Copy frontend
run: echo "coping frontend to ${{inputs.domain}}"
- name: Deploy frontend
run: echo "deploying frontend to ${{inputs.domain}}"

deploy-backend:
name: Backend
runs-on: ubuntu-latest
environment: ${{inputs.domain}}

steps:
- name: Copy backend
run: echo "coping backend to ${{inputs.domain}}"
- name: Deploy backend
run: echo "deploying backend to ${{inputs.domain}}"

deploy-database:
name: Database
runs-on: ubuntu-latest
environment: ${{inputs.domain}}

steps:
- name: Copy database
run: echo "coping database to ${{inputs.domain}}"
- name: Deploy database
run: echo "deploying database to ${{inputs.domain}}"
102 changes: 102 additions & 0 deletions .github/workflows/demo-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@

name: Demo - Application deployment

on:
workflow_dispatch:
inputs:
name:
description: 'lalala'
default: 'fii'
required: true

env:
MY_PROD_SECRET: ${{ secrets.LE_SECRET }} # set this to your preferred AWS region, e.g. us-west-1


permissions:
contents: read

jobs:
build-api:
name: Build Backend app
runs-on: ubuntu-latest

steps:
- name: build pims-api
run: echo "Building app"
- name: store image
run: echo "storing app image"

build-frontend:
name: Build Frontend
runs-on: ubuntu-latest

steps:
- name: Build Frontend app
run: echo "bBuilding frontendapp"
- name: TEST Secrety
run: echo "storing frontend image"

deploy-dev-gate:
name: Dev approval
runs-on: ubuntu-latest
environment: dev
steps:
- name: store image
run: echo "Approval for deployment to DEV"
needs: [build-api, build-frontend]
Comment on lines +40 to +47
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Job to gate the next events until it has been approved


deploy-dev:
name: Dev deploy
uses: ./.github/workflows/demo-db-deploy.yml
with:
domain: dev
needs: [deploy-dev-gate]

deploy-test-gate:
name: Test approval
runs-on: ubuntu-latest
environment: test
steps:
- name: approval
run: echo "Approval for deployment to TEST"
needs: [deploy-dev]

deploy-test:
name: Test deploy
uses: ./.github/workflows/demo-db-deploy.yml
with:
domain: test
needs: [deploy-test-gate]

deploy-uat-gate:
name: UAT approval
runs-on: ubuntu-latest
environment: uat
steps:
- name: approval
run: echo "Approval for deployment to UAT"
needs: [deploy-test]

deploy-uat:
name: UAT deploy
uses: ./.github/workflows/demo-db-deploy.yml
with:
domain: uat
needs: [deploy-uat-gate]

deploy-prod-gate:
name: Production approval
runs-on: ubuntu-latest
environment: prod
steps:
- name: approval
run: echo "Approval for deployment to PRODUCTION"
needs: [deploy-uat]

deploy-prod:
name: Production deploy
uses: ./.github/workflows/demo-db-deploy.yml
with:
domain: prod
needs: [deploy-prod-gate]
Loading
Loading