-
Notifications
You must be signed in to change notification settings - Fork 19
85 lines (71 loc) · 2.43 KB
/
cd-vsd.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: cd-vsd-app
on:
workflow_dispatch:
push:
paths:
- 'vsd-app/**'
- 'vsd-interfaces/**'
- '.github/workflows/cd-vsd.yml'
env:
APP_NAME: vsd
BUILD_ID: ${{ github.server_url }}!${{ github.repository }}!${{ github.ref_name }}!${{ github.sha }}!${{ github.run_number }}
IMAGE_REGISTRY: ${{ secrets.OCP4_REGISTRY }}/${{ secrets.OCP4_NAMESPACE }}
jobs:
build-vsd-api:
runs-on: ubuntu-latest
if: github.repository_owner == 'bcgov'
env:
IMAGE_NAME: api
VSD_API_DOCKERFILE_PATH: ./vsd-app/Dockerfile
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx tooling
uses: docker/setup-buildx-action@v3
- name: Log into OpenShift Registry
uses: docker/login-action@v3
with:
registry: ${{ env.IMAGE_REGISTRY }}
username: ${{ secrets.OCP4_USERNAME }}
password: ${{ secrets.OCP4_PASSWORD }}
- name: Pull image
run: docker pull $IMAGE_ID || true
- name: Build and push vsd-app
uses: docker/build-push-action@v6
with:
build-args: |
BUILD_ID="${{ env.BUILD_ID }}"
cache-from: |
${{ env.IMAGE_REGISTRY }}/${{ env.APP_NAME }}-${{ env.IMAGE_NAME }}
file: ${{ env.VSD_API_DOCKERFILE_PATH }}
push: true
tags: |
${{ env.IMAGE_REGISTRY }}/${{ env.APP_NAME }}-${{ env.IMAGE_NAME }}:dev
build-vsd-ui:
runs-on: ubuntu-latest
if: github.repository_owner == 'bcgov'
env:
IMAGE_NAME: ui
VSD_UI_DOCKERFILE_PATH: ./vsd-app/ClientApp/Dockerfile
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx tooling
uses: docker/setup-buildx-action@v3
- name: Log into OpenShift Registry
uses: docker/login-action@v3
with:
registry: ${{ env.IMAGE_REGISTRY }}
username: ${{ secrets.OCP4_USERNAME }}
password: ${{ secrets.OCP4_PASSWORD }}
- name: Pull image
run: docker pull $IMAGE_ID || true
- name: Build and push vsd-app
uses: docker/build-push-action@v6
with:
build-args: |
BUILD_ID="${{ env.BUILD_ID }}"
cache-from: |
${{ env.IMAGE_REGISTRY }}/${{ env.APP_NAME }}-${{ env.IMAGE_NAME }}
file: ${{ env.VSD_UI_DOCKERFILE_PATH }}
push: true
tags: |
${{ env.IMAGE_REGISTRY }}/${{ env.APP_NAME }}-${{ env.IMAGE_NAME }}:dev