Skip to content

adds sdp2

adds sdp2 #22

name: Build and Deploy VSS in DEV
on:
push:
branches:
- dev
env:
BRANCH_NAME: "dev"
jobs:
# Print variables for logging and debugging purposes
checkEnv:
name: Check Env variables
runs-on: ubuntu-latest
steps:
- name: Print Env Vars
run: |
echo Git Trigger Ref: ${{ github.ref }}
echo Git Base Ref: ${{ github.base_ref }}
echo Git Build ID: ${{ github.event.number }}
echo Git Pull Request Ref: ${{ github.event.pull_request.head.sha }}
echo OC CLI Version: $(oc version)
echo Running on branch: ${{ env.BRANCH_NAME }}
# Build the API
build:
name: Build VSS DEV Project
runs-on: ubuntu-latest
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
env:
BUILD_ID: ${{ github.event.number }}
NAMESPACE: 06cb9b-dev
BUILD_NAMESPACE: 06cb9b-tools
BUILD_REF: ${{ github.base_ref }}
HOST_PREFIX: tbtb-vss
SOURCE_REPOSITORY_BRANCH: dev
steps:
# Checkout the PR branch
- name: Print env
run: |
echo BUILD ID: $BUILD_ID
echo BUILD NAMESPACE: $BUILD_NAMESPACE
echo BRANCH: $BUILD_REF
- name: Checkout Target Branch
uses: actions/checkout@v3
# Log in to OpenShift.
# Note: The secrets needed to log in are NOT available if the PR comes from a FORK.
# PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail.
- name: Log in to OpenShift
run: |
oc login --token=${{ secrets.SA_TOKEN }} --server=https://api.silver.devops.gov.bc.ca:6443
- name: OC Build from yaml
working-directory: "./openshift"
run: |
make oc-build-web
- name: Finished OC Build from yaml
run: |
echo "FINISHED OC BUILD WEB"
echo ++++++++++
# Deploy project
deployDev:
name: Deploy Dev Project
runs-on: ubuntu-latest
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
#if: ${{ github.event.pull_request.merged == true && github.base_ref != 'prod' && github.base_ref != 'test'}}
env:
BUILD_ID: ${{ github.event.number }}
NAMESPACE: 06cb9b-dev
BUILD_NAMESPACE: 06cb9b-tools
BUILD_REF: ${{ github.base_ref }}
HOST_PREFIX: tbtb-vss
SOURCE_REPOSITORY_BRANCH: dev
needs:
- build
steps:
- name: Print env
run: |
echo BUILD ID: $BUILD_ID
echo BUILD NAMESPACE: $BUILD_NAMESPACE
echo NAMESPACE: $NAMESPACE
echo BRANCH: $BUILD_REF
echo HOST_PREFIX: $HOST_PREFIX
echo SOURCE_REPOSITORY_BRANCH: $SOURCE_REPOSITORY_BRANCH
# Checkout the PR branch
- name: Checkout Target Branch
uses: actions/checkout@v3
# Log in to OpenShift.
# Note: The secrets needed to log in are NOT available if the PR comes from a FORK.
# PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail.
- name: Log in to OpenShift
run: |
oc login --token=${{ secrets.SA_TOKEN }} --server=https://api.silver.devops.gov.bc.ca:6443
# Deploy the VSS.
- name: Deploy VSS dev
working-directory: "./openshift"
run: |
make oc-deploy-web
- name: Finished OC Deploy from yaml
run: |
echo "FINISHED OC Deploy WEB"
echo ++++++++++