-
Notifications
You must be signed in to change notification settings - Fork 31
81 lines (72 loc) · 2.76 KB
/
harbour-build-ui.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
name: Build and export CAP UI image
on:
push:
branches: ['master', 'dev', 'qa', 'test']
paths:
- "ui/**"
- ".github/workflows/ui-test.yml"
jobs:
build-image:
needs: UITest
name: Build and export ui image
runs-on: ubuntu-20.04
outputs:
image-id: ${{ steps.build-ui.outputs.image-id }}
steps:
- uses: actions/checkout@v3
- name: Extract branch name
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT
id: get_branch
- id: build-ui
name: Build and export
uses: cern-sis/gh-workflows/.github/actions/[email protected]
with:
dockerfile: ./docker/harbour/ui/Dockerfile
platforms: linux/amd64,linux/arm64
image: cern-sis/cap-ui
registry: registry.cern.ch
cache: false
tags: ${{ steps.get_branch.outputs.BRANCH_NAME }}
username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_PASSWORD }}
build-args: |
BRANCH_NAME=${{ steps.get_branch.outputs.BRANCH_NAME }}
PIWIK_ENV=${{ steps.get_branch.outputs.BRANCH_NAME }}
CAP_PIWIK_URL=${{ secrets.CAP_PIWIK_URL }}
CAP_PIWIK_SITEID_DEV=${{ secrets.CAP_PIWIK_SITEID_DEV }}
CAP_PIWIK_SITEID_PROD=${{ secrets.CAP_PIWIK_SITEID_PROD }}
CAP_PIWIK_SITEID_QA=${{ secrets.CAP_PIWIK_SITEID_QA }}
CAP_PIWIK_SITEID_TEST=${{ secrets.CAP_PIWIK_SITEID_TEST }}
- id: build-ui-e2e
name: Build and export for end to end image
uses: cern-sis/gh-workflows/.github/actions/[email protected]
if: ${{ steps.get_branch.outputs.BRANCH_NAME }} == 'qa'
with:
dockerfile: ./docker/harbour/ui/Dockerfile
platforms: linux/amd64,linux/arm64
image: cern-sis/cap-ui
registry: registry.cern.ch
cache: false
tags: qa-e2e
username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_PASSWORD }}
build-args: |
BRANCH_NAME=${{ steps.get_branch.outputs.BRANCH_NAME }}
ENABLE_E2E=True
PIWIK_ENV=${{ steps.get_branch.outputs.BRANCH_NAME }}
CAP_PIWIK_URL=${{ secrets.CAP_PIWIK_URL }}
CAP_PIWIK_SITEID_QA=${{ secrets.CAP_PIWIK_SITEID_QA }}
deploy:
needs: build-image
name: update-image
runs-on: ubuntu-20.04
steps:
- name: send event
uses: cern-sis/gh-workflows/.github/actions/[email protected]
with:
event-type: update
token: ${{ secrets.PAT_FIRE_EVENTS_ON_CERN_SIS_KUBERNETES_CAP }}
repo: cern-sis/kubernetes-cap
images: |
cern-sis/cap-ui@{{ needs.build-image.outputs.image-id }}