attempts to fix latency #182
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: Build and Deploy USP in DEV | |
on: | |
push: | |
branches: | |
- 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 Base Ref: ${{ github.base_ref }} | |
echo Git Build ID: ${{ github.event.number }} | |
echo Git Pull Request Ref: ${{ github.event.pull_request.head.sha }} | |
echo Git Ref Name: ${{ github.ref_name }} | |
echo OC CLI Version: $(oc version) | |
# Build USP | |
build: | |
name: Build project | |
runs-on: ubuntu-latest | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
BUILD_ID: ${{ github.event.number }} | |
NAMESPACE: fc0a26-dev | |
BUILD_NAMESPACE: fc0a26-tools | |
BUILD_REF: ${{ github.base_ref }} | |
HOST_PREFIX: usp | |
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@v4 | |
- name: Install OpenShift CLI | |
uses: redhat-actions/openshift-tools-installer@v1 | |
with: | |
oc: latest | |
# 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 USP" | |
echo ++++++++++ | |
# Deploy project | |
deployDev: | |
name: Deploy Dev Project | |
runs-on: ubuntu-latest | |
if: github.ref_name == 'dev' | |
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: fc0a26-dev | |
BUILD_NAMESPACE: fc0a26-tools | |
BUILD_REF: ${{ github.base_ref }} | |
HOST_PREFIX: usp | |
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@v4 | |
- name: Install OpenShift CLI | |
uses: redhat-actions/openshift-tools-installer@v1 | |
with: | |
oc: latest | |
# 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 USP. | |
- name: Deploy USP dev | |
working-directory: "./openshift" | |
run: | | |
make oc-deploy-web | |
- name: Finished OC Deploy from yaml | |
run: | | |
echo "FINISHED OC Deploy DEV USP" | |
echo ++++++++++ |