Skip to content

Commit

Permalink
Split beta prod deployment 3 (#7)
Browse files Browse the repository at this point in the history
* Update manual deployment workflow

* Do beta deployment before prod deployment

* Merge expect-deployment and approve-deployment jobs
  • Loading branch information
JonJagger committed Dec 1, 2023
1 parent 3c47757 commit bc64f2b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 88 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/deploy-manually.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ on:
required: true

jobs:
deploy:
uses: cyber-dojo/differ/.github/workflows/sub_deploy.yml@main
deploy_to_beta:
uses: cyber-dojo/differ/.github/workflows/sub_deploy_to_beta.yml@main
with:
IMAGE_TAG: ${{ github.event.inputs.image_tag }}

deploy_to_prod:
uses: cyber-dojo/differ/.github/workflows/sub_deploy_to_prod.yml@main
with:
IMAGE_TAG: ${{ github.event.inputs.image_tag }}
24 changes: 3 additions & 21 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,41 +57,23 @@ jobs:
KOSLI_ENVIRONMENT: aws-beta
IMAGE_TAG: ${{ needs.variables.outputs.image_tag }}

expect-deployment-to-beta:
needs: [variables, approve-deployment-to-beta]
uses: cyber-dojo/differ/.github/workflows/sub_expect_deployment.yml@main
secrets:
KOSLI_API_TOKEN: ${{ secrets.KOSLI_API_TOKEN }}
with:
KOSLI_ENVIRONMENT: aws-beta
IMAGE_TAG: ${{ needs.variables.outputs.image_tag }}

deploy-to-beta:
needs: [variables, expect-deployment-to-beta]
needs: [variables, approve-deployment-to-beta]
uses: cyber-dojo/differ/.github/workflows/sub_deploy_to_beta.yml@main
with:
IMAGE_TAG: ${{ needs.variables.outputs.image_tag }}

approve-deployment-to-prod:
needs: [variables, sdlc-gate]
needs: [variables, deploy-to-beta]
uses: cyber-dojo/differ/.github/workflows/sub_approve_deployment.yml@main
secrets:
KOSLI_API_TOKEN: ${{ secrets.KOSLI_API_TOKEN }}
with:
KOSLI_ENVIRONMENT: aws-prod
IMAGE_TAG: ${{ needs.variables.outputs.image_tag }}

expect-deployment-to-prod:
needs: [variables, approve-deployment-to-prod]
uses: cyber-dojo/differ/.github/workflows/sub_expect_deployment.yml@main
secrets:
KOSLI_API_TOKEN: ${{ secrets.KOSLI_API_TOKEN }}
with:
KOSLI_ENVIRONMENT: aws-prod
IMAGE_TAG: ${{ needs.variables.outputs.image_tag }}

deploy-to-prod:
needs: [variables, expect-deployment-to-prod]
needs: [variables, approve-deployment-to-prod]
uses: cyber-dojo/differ/.github/workflows/sub_deploy_to_prod.yml@main
with:
IMAGE_TAG: ${{ needs.variables.outputs.image_tag }}
24 changes: 2 additions & 22 deletions .github/workflows/main_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,8 @@ jobs:
KOSLI_ENVIRONMENT: aws-beta
IMAGE_TAG: ${{ needs.variables.outputs.image_tag }}

expect-deployment-to-beta:
needs: [variables, approve-deployment-to-beta]
uses: cyber-dojo/differ/.github/workflows/sub_expect_deployment.yml@main
secrets:
KOSLI_API_TOKEN: ${{ secrets.KOSLI_API_TOKEN }}
with:
KOSLI_ENVIRONMENT: aws-beta
KOSLI_HOST: ${{ needs.variables.outputs.kosli_host }}
IMAGE_TAG: ${{ needs.variables.outputs.image_tag }}

approve-deployment-to-prod:
needs: [variables, sdlc-gate]
needs: [variables, approve-deployment-to-beta]
uses: cyber-dojo/differ/.github/workflows/sub_approve_deployment.yml@main
secrets:
KOSLI_API_TOKEN: ${{ secrets.KOSLI_API_TOKEN }}
Expand All @@ -104,18 +94,8 @@ jobs:
KOSLI_ENVIRONMENT: aws-prod
IMAGE_TAG: ${{ needs.variables.outputs.image_tag }}

expect-deployment-to-prod:
needs: [variables, approve-deployment-to-prod]
uses: cyber-dojo/differ/.github/workflows/sub_expect_deployment.yml@main
secrets:
KOSLI_API_TOKEN: ${{ secrets.KOSLI_API_TOKEN }}
with:
KOSLI_ENVIRONMENT: aws-prod
KOSLI_HOST: ${{ needs.variables.outputs.kosli_host }}
IMAGE_TAG: ${{ needs.variables.outputs.image_tag }}

push-latest:
needs: [variables, sdlc-gate]
needs: [variables, approve-deployment-to-prod]
uses: cyber-dojo/differ/.github/workflows/sub_push_latest.yml@main
secrets:
DOCKER_PASS: ${{ secrets.DOCKER_PASS }}
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/sub_approve_deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,10 @@ jobs:
--environment=${{ inputs.KOSLI_ENVIRONMENT }} \
--approver="${{ github.actor }}"
- name: Report expected deployment to Kosli
run: |
docker pull cyberdojo/differ:${{ inputs.IMAGE_TAG }}
kosli expect deployment cyberdojo/differ:${{ inputs.IMAGE_TAG }} \
--artifact-type=docker \
--description="Deployed to ${{ inputs.KOSLI_ENVIRONMENT }} in Github Actions pipeline" \
--environment=${{ inputs.KOSLI_ENVIRONMENT }}
43 changes: 0 additions & 43 deletions .github/workflows/sub_expect_deployment.yml

This file was deleted.

0 comments on commit bc64f2b

Please sign in to comment.