-
Notifications
You must be signed in to change notification settings - Fork 9
61 lines (49 loc) · 1.3 KB
/
api-cd.test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Deploy API to test
on:
push:
branches:
- master
paths:
- "api/**"
- ".github/workflows/api-cd.test.yml"
workflow_dispatch:
inputs:
environment:
description: "Environment (dev/test/prod)"
required: true
default: "test"
defaults:
run:
shell: bash
working-directory: ./api
env:
APP_NAME: "api"
TAG_NAME: "test"
jobs:
api-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 text branch
shell: bash
run: |
oc patch bc/api-master-build -p '{"spec":{"source":{"git":{"ref":"master"}}}}'
- name: Start Build Openshift
shell: bash
run: |
oc start-build api-master-build --wait
- name: Tag+Deploy for test
shell: bash
run: |
oc tag api:latest api:${{ env.TAG_NAME }}