This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continuous Integration And Deployment On Push to DEV | |
on: | |
workflow_dispatch: # TODO this is there for testing purposes, once the pipelines are all done, remove this | |
push: | |
branches: | |
- 'master' | |
- 'caseflow-ci-cd' #sakthi | |
paths: | |
- 'app/**' | |
- 'app/caseflow_core/**' | |
- 'app/caseflow_web/**' | |
- '.github/workflows/ci-cd-openshift-dev.yml' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
builds: | |
name: Builds | |
uses: ./.github/workflows/_build.yml | |
strategy: | |
matrix: | |
component: [app/caseflow_core/microservices/dms, app/caseflow_core/microservices/gateway, app/caseflow_core/microservices/lob, app/caseflow_core/microservices/server] | |
include: | |
- component: app/caseflow_core/microservices/dms | |
triggers: ('app/caseflow_core/microservices/dms/') | |
- component: app/caseflow_core/microservices/gateway | |
triggers: ('app/caseflow_core/microservices/gateway/') | |
- component: app/caseflow_core/microservices/lob | |
triggers: ('app/caseflow_core/microservices/lob/') | |
- component: app/caseflow_core/microservices/server | |
triggers: ('app/caseflow_core/microservices/server/') | |
# - component: app/caseflow_web | |
# triggers: ('app/caseflow_web/') | |
secrets: | |
gh_token: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
component: ${{ matrix.component }} | |
img_build: "dev" # ask the team dev or latest | |
img_fallback: dev | |
triggers: ${{ matrix.triggers }} | |
# TODO - REIMPLMENET BEFORE MERGING, JUST TESTING WITHOUT THESE TO VERIFY DEPLOYS | |
tests: | |
name: Unit Tests | |
uses: ./.github/workflows/_code-cov.yml | |
strategy: | |
matrix: | |
component: [app/caseflow_core/microservices/dms, app/caseflow_core/microservices/gateway, app/caseflow_core/microservices/lob, app/caseflow_core/microservices/server] | |
secrets: | |
gh_token: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
component: ${{ matrix.component }} | |
lcov_file: ${{ matrix.component }}/coverage/lcov.info | |
test_cmd: npm run test:cov | |
deploys: | |
name: Deploys | |
needs: | |
- builds | |
# If any of the previous created a build, then deploy | |
# TODO - RE-ENABLE IF COMMAND BELOW, DISABLED DURING EXPERIMENTAL DEV | |
if: contains(needs.*.outputs.build, 'true') | |
uses: ./.github/workflows/_deploy.yml | |
strategy: | |
matrix: | |
component: [app/caseflow_core/microservices/dms, app/caseflow_core/microservices/gateway, app/caseflow_core/microservices/lob, app/caseflow_core/microservices/server, app/caseflow_web, daabase] | |
include: | |
- component: database | |
overwrite: false | |
template_file: .github/openshift/deploy.database.yml | |
template_vars: -p DB_PVC_SIZE=200Mi | |
- component: backend/applications | |
overwrite: true | |
template_file: .github/openshift/deploy.backend-applications.yml | |
template_vars: -p PROMOTE=${{ github.repository }}/backend/applications -p CONTAINER_PORT=4006 -p ENV=dev -p IMAGE_TAG=dev | |
- component: backend/gateway | |
overwrite: true | |
template_file: .github/openshift/deploy.backend-gateway.yml | |
template_vars: -p PROMOTE=${{ github.repository }}/backend/gateway -p CONTAINER_PORT=4010 -p ENV=dev -p IMAGE_TAG=dev | |
- component: backend/legacy | |
overwrite: true | |
template_file: .github/openshift/deploy.backend-legacy.yml | |
template_vars: -p PROMOTE=${{ github.repository }}/backend/legacy -p CONTAINER_PORT=4011 -p ENV=dev -p IMAGE_TAG=dev | |
- component: backend/users | |
overwrite: true | |
template_file: .github/openshift/deploy.backend-users.yml | |
template_vars: -p PROMOTE=${{ github.repository }}/backend/users -p CONTAINER_PORT=4005 -p ENV=dev -p IMAGE_TAG=dev | |
- component: frontend | |
overwrite: true | |
template_file: .github/openshift/deploy.frontend.yml | |
template_vars: -p PROMOTE=${{ github.repository }}/frontend -p CONTAINER_PORT=8080 -p ENV=dev -p IMAGE_TAG=dev | |
secrets: | |
oc_namespace: ${{ secrets.OC_NAMESPACE }} | |
oc_server: ${{ secrets.OC_SERVER }} | |
oc_token: ${{ secrets.OC_TOKEN }} | |
with: | |
environment: dev | |
component: ${{ matrix.component }} | |
overwrite: ${{ matrix.overwrite }} | |
template_file: ${{ matrix.template_file }} | |
template_vars: ${{ matrix.template_vars }} |