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

Commit

Permalink
CICD: Added Workflows & Docker Manifests
Browse files Browse the repository at this point in the history
  • Loading branch information
awshuss committed Nov 21, 2023
1 parent 366da1b commit 08fdfb1
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 98 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/ci.yaml

This file was deleted.

155 changes: 78 additions & 77 deletions .github/workflows/non-prod-internal-web-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: CI/CD NON PROD INTERNAL WEB
run-name: CI/CD NON PROD INTERNAL WEB

on:
pull_request:
push:
branches:
- master
Expand Down Expand Up @@ -149,104 +150,104 @@ jobs:
outputs:
image_tag: ${{ steps.push-image.outputs.image_tag }}

deploy-on-non-prod-cluster:
# deploy-on-non-prod-cluster:

name: Deploy on Non Prod Cluster
if: github.ref == 'refs/heads/master'
# name: Deploy on Non Prod Cluster
# if: github.ref == 'refs/heads/master'

needs:
- unit-tests
# - security
# - static-analysis
# - tests
- build-test-push-sign-image
# needs:
# - unit-tests
# # - security
# # - static-analysis
# # - tests
# - build-test-push-sign-image

runs-on: ubuntu-latest
# runs-on: ubuntu-latest

steps:
# steps:

- name: Deploy
run: |
echo 'Deploy on Non Prod'
# - name: Deploy
# run: |
# echo 'Deploy on Non Prod'

# uses: dvsa/.github/.github/workflows/trigger-github-workflow.yaml@feature/AddMiscAuxilaryWorkflows
# with:
# branch: 'feature/AWSRESET1-514'
# git_repository: 'dvsa/dvsa-container-registry'
# workflow_name: 'CD NON PROD INTERNAL WEB'
# input_arguments: 'iuweb_image_tag=${{ needs.build-test-push-sign-image.outputs.image_tag }}'
# secrets:
# gh_token: ${{ secrets.DVSA_VOL_TERRAFORM_ACCESS_TOKEN }}
# # uses: dvsa/.github/.github/workflows/trigger-github-workflow.yaml@feature/AddMiscAuxilaryWorkflows
# # with:
# # branch: 'feature/AWSRESET1-514'
# # git_repository: 'dvsa/dvsa-container-registry'
# # workflow_name: 'CD NON PROD INTERNAL WEB'
# # input_arguments: 'iuweb_image_tag=${{ needs.build-test-push-sign-image.outputs.image_tag }}'
# # secrets:
# # gh_token: ${{ secrets.DVSA_VOL_TERRAFORM_ACCESS_TOKEN }}

automation-tests:
# automation-tests:

name: Run Automation Tests
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
# name: Run Automation Tests
# if: github.ref == 'refs/heads/master'
# runs-on: ubuntu-latest

needs:
- deploy-on-non-prod-cluster
# needs:
# - deploy-on-non-prod-cluster

steps:
# steps:

- name: Run automation tests
run: |
echo 'Run automation tests'
# - name: Run automation tests
# run: |
# echo 'Run automation tests'

build-nonprod-approved-image:
# build-nonprod-approved-image:

name: Build Non PROD Approved Image
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
# name: Build Non PROD Approved Image
# if: github.ref == 'refs/heads/master'
# runs-on: ubuntu-latest

needs:
- build-test-push-sign-image
- deploy-on-non-prod-cluster
- automation-tests
# needs:
# - build-test-push-sign-image
# - deploy-on-non-prod-cluster
# - automation-tests

steps:
# steps:

- name: IUWEB_IMAGE_TAG & NONPROD_IUWEB_IMAGE_TAG
run: |
echo "IUWEB_IMAGE_TAG=${{ needs.build-test-push-sign-image.outputs.image_tag }}" >> $GITHUB_ENV
echo "NONPROD_IUWEB_IMAGE_TAG=nonprod-${{ needs.build-test-push-sign-image.outputs.image_tag }}" >> $GITHUB_ENV
# - name: IUWEB_IMAGE_TAG & NONPROD_IUWEB_IMAGE_TAG
# run: |
# echo "IUWEB_IMAGE_TAG=${{ needs.build-test-push-sign-image.outputs.image_tag }}" >> $GITHUB_ENV
# echo "NONPROD_IUWEB_IMAGE_TAG=nonprod-${{ needs.build-test-push-sign-image.outputs.image_tag }}" >> $GITHUB_ENV

- name: Configure AWS credentials on Non Production IUWEB ECR
uses: aws-actions/[email protected]
with:
role-to-assume: ${{ secrets.VOL_AWS_ROLE_TOOLING_NONPROD }}
role-session-name: GitHub_to_AWS_via_FederatedOIDC
aws-region: ${{ env.AWS_REGION }}
# - name: Configure AWS credentials on Non Production IUWEB ECR
# uses: aws-actions/[email protected]
# with:
# role-to-assume: ${{ secrets.VOL_AWS_ROLE_TOOLING_NONPROD }}
# role-session-name: GitHub_to_AWS_via_FederatedOIDC
# aws-region: ${{ env.AWS_REGION }}

- name: Login to Non Production IUWEB ECR
id: login-ecr-iuweb-tooling-non-prod
uses: aws-actions/[email protected]
# - name: Login to Non Production IUWEB ECR
# id: login-ecr-iuweb-tooling-non-prod
# uses: aws-actions/[email protected]

- name: Push Internal Web image
if: github.ref == 'refs/heads/master'
id: push-approved-image
run: |
echo "approved_image_tag=${NONPROD_IUWEB_IMAGE_TAG}" >> $GITHUB_OUTPUT
docker pull ${IUWEB_NONPROD_TOOLING_REPO_URL}:${IUWEB_IMAGE_TAG}
docker tag ${IUWEB_NONPROD_TOOLING_REPO_URL}:${IUWEB_IMAGE_TAG} ${IUWEB_NONPROD_TOOLING_REPO_URL}:${NONPROD_IUWEB_IMAGE_TAG}
docker push ${IUWEB_NONPROD_TOOLING_REPO_URL}:${NONPROD_IUWEB_IMAGE_TAG}
# - name: Push Internal Web image
# if: github.ref == 'refs/heads/master'
# id: push-approved-image
# run: |
# echo "approved_image_tag=${NONPROD_IUWEB_IMAGE_TAG}" >> $GITHUB_OUTPUT
# docker pull ${IUWEB_NONPROD_TOOLING_REPO_URL}:${IUWEB_IMAGE_TAG}
# docker tag ${IUWEB_NONPROD_TOOLING_REPO_URL}:${IUWEB_IMAGE_TAG} ${IUWEB_NONPROD_TOOLING_REPO_URL}:${NONPROD_IUWEB_IMAGE_TAG}
# docker push ${IUWEB_NONPROD_TOOLING_REPO_URL}:${NONPROD_IUWEB_IMAGE_TAG}

outputs:
approved_image_tag: ${{ steps.push-approved-image.outputs.approved_image_tag }}
# outputs:
# approved_image_tag: ${{ steps.push-approved-image.outputs.approved_image_tag }}

qa-approval:
# qa-approval:

name: QA Internal Web Image Approval
if: github.ref == 'refs/heads/master'
# name: QA Internal Web Image Approval
# if: github.ref == 'refs/heads/master'

needs:
- build-nonprod-approved-image
# needs:
# - build-nonprod-approved-image

uses: dvsa/.github/.github/workflows/trigger-github-workflow.yaml@feature/AddMiscAuxilaryWorkflows
with:
branch: 'feature/AddWorkflows'
git_repository: 'dvsa/olcs-internal'
workflow_name: 'qa-internal-web-approval.yaml'
input_arguments: 'iuweb_image_tag=${{ needs.build-nonprod-approved-image.outputs.approved_image_tag }}'
secrets:
gh_token: ${{ secrets.DVSA_VOL_TERRAFORM_ACCESS_TOKEN }}
# uses: dvsa/.github/.github/workflows/trigger-github-workflow.yaml@feature/AddMiscAuxilaryWorkflows
# with:
# branch: 'feature/AddWorkflows'
# git_repository: 'dvsa/olcs-internal'
# workflow_name: 'qa-internal-web-approval.yaml'
# input_arguments: 'iuweb_image_tag=${{ needs.build-nonprod-approved-image.outputs.approved_image_tag }}'
# secrets:
# gh_token: ${{ secrets.DVSA_VOL_TERRAFORM_ACCESS_TOKEN }}

0 comments on commit 08fdfb1

Please sign in to comment.