generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): demo routing workflow (#1444)
- Loading branch information
1 parent
ede39cc
commit dc66232
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: DEMO Route | ||
|
||
on: | ||
label: | ||
types: [created] | ||
workflow_dispatch: | ||
inputs: | ||
target: | ||
description: 'PR number to receive DEMO URL routing' | ||
required: true | ||
type: number | ||
|
||
concurrency: | ||
group: ${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
demo-routing: | ||
name: DEMO Routing | ||
if: ${{ event.type == 'workflow_dispatch' || github.event.label.name == 'demo' }} | ||
env: | ||
DEST: demo | ||
DOMAIN: apps.silver.devops.gov.bc.ca | ||
REPO: ${{ github.event.repository.name }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Point DEMO URL to Existing Service | ||
run: | | ||
# Set Up Routing | ||
# Login | ||
oc login --token=${{ secrets.oc_token }} --server=${{ vars.oc_server }} | ||
oc project ${{ secrets.oc_namespace }} #Safeguard! | ||
# Delete and replace route | ||
oc delete route/${{ env.REPO }}-${{ env.DEST }} --ignore-not-found=true | ||
oc create route edge ${{ env.REPO }}-${{ env.DEST }} \ | ||
--hostname=${{ env.REPO }}-${{ env.DEST }}.${{ env.DOMAIN }} \ | ||
--service=${{ env.REPO }}-${{ github.event.number || inputs.target }}-frontend |