-
Notifications
You must be signed in to change notification settings - Fork 11
57 lines (54 loc) · 2.54 KB
/
deploy-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
name: Openshift deployer
on:
push:
branches:
- dev
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install oc client v3.11.0
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
run: |
cd $HOME
curl -LO https://github.com/openshift/origin/releases/download/v3.11.0/openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit.tar.gz
tar -xf openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit.tar.gz
cd openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit
chmod +x oc
echo "::set-env name=PATH_TO_OC::$PATH:$(pwd)"
- name: Login to openshift
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
run: |
cd $HOME
export PATH=$PATH_TO_OC
/home/runner/openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit/oc login https://console.pathfinder.gov.bc.ca:8443 --token=${{ secrets.sa_token }}
- name: Build image
env:
APP_NAME: range-myra-web-ghactiontest
IMAGE_STREAM_NAME: $APP_NAME
GIT_BRANCH_NAME: ${GITHUB_REF##*/}
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
run: |
cd $HOME
export PATH=$PATH_TO_OC
cd $GITHUB_WORKSPACE
/home/runner/openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit/oc version
/home/runner/openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit/oc project range-myra-tools
/home/runner/openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit/oc cancel-build bc/range-myra-web-dev-build
/home/runner/openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit/oc start-build range-myra-web-dev-build -F
- name: Build caddy image & tag image
env:
APP_NAME: range-myra-web-ghactiontest
IMAGE_STREAM_NAME: $APP_NAME
GIT_BRANCH_NAME: ${GITHUB_REF##*/}
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
run: |
cd $HOME
export PATH=$PATH_TO_OC
/home/runner/openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit/oc project range-myra-tools
/home/runner/openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit/oc cancel-build bc/range-myra-web-caddy-dev-build
/home/runner/openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit/oc start-build range-myra-web-caddy-dev-build --wait=true
/home/runner/openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit/oc tag range-myra-web-caddy:latest range-myra-web-caddy:test