Merge pull request #245 from bcgov/feature/AB#9262-sector-graph-in-da… #150
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
# This is a workflow that is either manually or PR merge to "dev" triggered | |
name: Dev - Build | |
on: | |
push: | |
branches: [ "dev" ] | |
paths-ignore: | |
- '.github/**' | |
- '.gitignore' | |
- 'applications/Unity.Metabase/**' | |
- 'database/**' | |
- 'documentation/**' | |
- 'openshift/**' | |
- 'COMPLIANCE.yaml' | |
- 'CONTRIBUTING.md' | |
- 'LICENSE' | |
- 'README.md' | |
- 'SECURITY.md' | |
# Allow manual workflow triggering | |
workflow_dispatch: | |
# Workflow dependencies are repository service connector and product version + commit buildId | |
env: | |
OPENSHIFT_CLUSTER: https://api.silver.devops.gov.bc.ca:6443 | |
OPENSHIFT_AUTH_TOKEN: ${{secrets.OPENSHIFT_TOKEN_DEV}} | |
RELEASE_VERSION: ${{vars.VERSION_MAJOR}}.${{vars.VERSION_MINOR}}.${{vars.VERSION_PATCH}} | |
jobs: | |
# This workflow contains a job called "Build" with steps to set buildArgs, build and push images to container registry | |
Build: | |
runs-on: ubuntu-latest | |
outputs: | |
PROJECT: ${{steps.project.outputs.TARGET_PROJECT}} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get BuildId | |
id: commit | |
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
- name: Set buildArgs | |
run: | | |
echo "buildArgs UNITY_BUILD_VERSION: ${{env.RELEASE_VERSION}}, UNITY_BUILD_REVISION: ${{steps.commit.outputs.sha_short}}" | |
- name: Build Docker images | |
run: | | |
rm -f ./docker-compose.override.yml | |
docker compose build --build-arg UNITY_BUILD_VERSION=${{env.RELEASE_VERSION}} --build-arg UNITY_BUILD_REVISION=${{steps.commit.outputs.sha_short}} | |
working-directory: ./applications/Unity.GrantManager | |
- name: Connect to OpenShift API | |
id: project | |
run: | | |
oc login --token=${{env.OPENSHIFT_AUTH_TOKEN}} --server=${{env.OPENSHIFT_CLUSTER}} | |
echo "PROJECT=$(oc project | grep -oE '[0-9a-z]*-[dev\|test\|prod\|tools]*')" >> $GITHUB_OUTPUT | |
oc registry login | |
- name: Push build images to container registry | |
run: | | |
echo project = ${{steps.project.outputs.PROJECT}} | |
docker tag unity-grantmanager-web image-registry.apps.silver.devops.gov.bc.ca/${{steps.project.outputs.PROJECT}}/unity-grantmanager-web:github-latest | |
docker tag unity-grantmanager-dbmigrator image-registry.apps.silver.devops.gov.bc.ca/${{steps.project.outputs.PROJECT}}/unity-grantmanager-dbmigrator:github-latest | |
# docker push image-registry.apps.silver.devops.gov.bc.ca/${{steps.project.outputs.PROJECT}}/unity-grantmanager-web:github-latest | |
# docker push image-registry.apps.silver.devops.gov.bc.ca/${{steps.project.outputs.PROJECT}}/unity-grantmanager-dbmigrator:github-latest |