Merge pull request #291 from bcgov/dev #31
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: Deploy web to test | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- "web/**" | |
- ".github/workflows/web-cd.test.yml" | |
workflow_dispatch: | |
inputs: | |
environment: | |
description: "Environment (dev/test/prod)" | |
required: true | |
default: "test" | |
defaults: | |
run: | |
shell: bash | |
working-directory: ./web | |
env: | |
APP_NAME: "web" | |
TAG_NAME: "test" | |
jobs: | |
web-cd-by-push: | |
runs-on: ubuntu-20.04 | |
if: github.event_name == 'push' && github.repository == 'bcgov/foi-requests' | |
environment: | |
name: "test" | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Login Openshift | |
shell: bash | |
run: | | |
oc login --server=${{secrets.OPENSHIFT4_LOGIN_REGISTRY}} --token=${{secrets.OPENSHIFT4_SA_TOKEN}} | |
- name: Tools project | |
shell: bash | |
run: | | |
oc project ${{ secrets.OPENSHIFT4_FRONTEND_REPOSITORY }}-tools | |
- name: Build from master branch | |
shell: bash | |
run: | | |
oc patch bc/web-artifact-build -p '{"spec":{"source":{"git":{"ref":"master"}}}}' | |
- name: Start Build Openshift part 1/2 | |
shell: bash | |
run: | | |
oc start-build web-artifact-build --wait | |
- name: Start Build Openshift part 2/2 | |
shell: bash | |
run: | | |
oc start-build web-image-build --wait | |
- name: Tag+Deploy for test | |
shell: bash | |
run: | | |
oc tag web:latest web:${{ env.TAG_NAME }} |