Skip to content

Merge pull request #336 from bcgov/dev-JC-NP-FOIMOD-3405 #28

Merge pull request #336 from bcgov/dev-JC-NP-FOIMOD-3405

Merge pull request #336 from bcgov/dev-JC-NP-FOIMOD-3405 #28

Workflow file for this run

name: Deploy API to dev
on:
push:
branches:
- dev
- dev-AC-1355
paths:
- "api/**"
- ".github/workflows/api-cd.dev.yml"
workflow_dispatch:
inputs:
environment:
description: "Environment (dev/test/prod)"
required: true
default: "dev"
defaults:
run:
shell: bash
working-directory: ./api
env:
APP_NAME: "api"
TAG_NAME: "dev"
jobs:
api-cd-by-push:
runs-on: ubuntu-20.04
if: github.event_name == 'push' && github.repository == 'bcgov/foi-requests'
environment:
name: "dev"
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 text branch
shell: bash
run: |
oc patch bc/api-master-build -p '{"spec":{"source":{"git":{"ref":"dev"}}}}'
- name: Start Build Openshift
shell: bash
run: |
oc start-build api-master-build --wait
- name: Tag+Deploy for dev
shell: bash
run: |
oc tag api:latest api:${{ env.TAG_NAME }}