Skip to content

Commit 15b6941

Browse files
committed
Do not build when /apps/<saas> apps changed
1 parent ed879f8 commit 15b6941

File tree

3 files changed

+91
-64
lines changed

3 files changed

+91
-64
lines changed

.github/workflows/koku-ui-onprem-push-main.yml

Lines changed: 7 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -4,69 +4,12 @@ on:
44
push:
55
branches:
66
- main
7-
tags:
8-
- 'onprem-*'
9-
env:
10-
QUAY_ORG: quay.io/insights-onprem
11-
QUAY_UI_REPO: koku-ui-onprem
7+
paths-ignore:
8+
- "apps/koku-ui-hcm/**"
9+
- "apps/koku-ui-ros/**"
1210

1311
jobs:
14-
generate-tags:
15-
runs-on: ubuntu-latest
16-
outputs:
17-
image_tags: ${{ steps.get-tags.outputs.image_tags }}
18-
steps:
19-
- uses: actions/checkout@v4
20-
with:
21-
fetch-depth: 0
22-
fetch-tags: true
23-
24-
- name: Generate image tags
25-
id: get-tags
26-
run: |
27-
if ${{ github.ref_type == 'tag' }}; then
28-
# The images tags will match the Release tag
29-
image_tags=( ${{ github.ref_name }} )
30-
image_tags=${image_tags#v} # remove the leading v prefix for version
31-
32-
echo "image_tags=${image_tags[@]}" >> $GITHUB_OUTPUT
33-
echo "image_tags=${image_tags[@]}"
34-
35-
else
36-
image_tags=( latest-${GITHUB_SHA} latest ${version} )
37-
echo "image_tags=${image_tags[@]}" >> $GITHUB_OUTPUT
38-
echo "image_tags=${image_tags[@]}"
39-
fi
40-
41-
publish-onprem-ui:
42-
runs-on: ubuntu-latest
43-
needs: [generate-tags]
44-
steps:
45-
- uses: actions/checkout@v4
46-
47-
- name: Build
48-
id: build
49-
uses: redhat-actions/buildah-build@v2
50-
with:
51-
image: ${{ env.QUAY_UI_REPO }}
52-
tags: ${{ needs.generate-tags.outputs.image_tags }}
53-
labels: |
54-
org.insights-onprem.koku-ui-onprem.github.repository=${{ github.repository }}
55-
org.insights-onprem.koku-ui-onprem.github.actor=${{ github.actor }}
56-
org.insights-onprem.koku-ui-onprem.github.run_id=${{ github.run_id }}
57-
org.insights-onprem.koku-ui-onprem.github.sha=${{ github.sha }}
58-
org.insights-onprem.koku-ui-onprem.github.ref_name=${{ github.ref_name }}
59-
extra-args: |
60-
--ulimit nofile=10000:10000
61-
containerfiles: apps/koku-ui-onprem/Containerfile
62-
context: .
63-
64-
- name: Push to Quay.io
65-
id: push
66-
uses: redhat-actions/[email protected]
67-
with:
68-
image: ${{ steps.build.outputs.image }}
69-
tags: ${{ needs.generate-tags.outputs.image_tags }}
70-
registry: ${{ env.QUAY_ORG }}
71-
username: ${{ secrets.QUAY_INSIGHTS_ONPREM_ROBOT_USERNAME }}
72-
password: ${{ secrets.QUAY_INSIGHTS_ONPREM_ROBOT_PASSWORD }}
12+
call-shared:
13+
uses: ./.github/workflows/koku-ui-onprem-push-shared.yml
14+
with:
15+
ref_type: "main"
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Koku UI OnPrem - build & push - shared
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
ref_type:
7+
required: true
8+
type: string
9+
10+
env:
11+
QUAY_ORG: quay.io/insights-onprem
12+
QUAY_UI_REPO: koku-ui-onprem
13+
14+
jobs:
15+
generate-tags:
16+
runs-on: ubuntu-latest
17+
outputs:
18+
image_tags: ${{ steps.get-tags.outputs.image_tags }}
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
fetch-tags: true
24+
25+
- name: Generate image tags
26+
id: get-tags
27+
run: |
28+
if [ "${GITHUB_REF_TYPE}" = "tag" ]; then
29+
# The images tags will match the Release tag
30+
image_tags=( "${GITHUB_REF_NAME#v}" ) # Strip leading v if present
31+
32+
echo "image_tags=${image_tags[@]}" >> $GITHUB_OUTPUT
33+
echo "image_tags=${image_tags[@]}"
34+
35+
else
36+
image_tags=( latest-${GITHUB_SHA} latest )
37+
echo "image_tags=${image_tags[@]}" >> $GITHUB_OUTPUT
38+
echo "image_tags=${image_tags[@]}"
39+
fi
40+
41+
publish-onprem-ui:
42+
runs-on: ubuntu-latest
43+
needs: [generate-tags]
44+
steps:
45+
- uses: actions/checkout@v4
46+
47+
- name: Build
48+
id: build
49+
uses: redhat-actions/buildah-build@v2
50+
with:
51+
image: ${{ env.QUAY_UI_REPO }}
52+
tags: ${{ needs.generate-tags.outputs.image_tags }}
53+
labels: |
54+
org.insights-onprem.koku-ui-onprem.github.repository=${{ github.repository }}
55+
org.insights-onprem.koku-ui-onprem.github.actor=${{ github.actor }}
56+
org.insights-onprem.koku-ui-onprem.github.run_id=${{ github.run_id }}
57+
org.insights-onprem.koku-ui-onprem.github.sha=${{ github.sha }}
58+
org.insights-onprem.koku-ui-onprem.github.ref_name=${{ github.ref_name }}
59+
extra-args: |
60+
--ulimit nofile=10000:10000
61+
containerfiles: apps/koku-ui-onprem/Containerfile
62+
context: .
63+
64+
- name: Push to Quay.io
65+
id: push
66+
uses: redhat-actions/[email protected]
67+
with:
68+
image: ${{ steps.build.outputs.image }}
69+
tags: ${{ needs.generate-tags.outputs.image_tags }}
70+
registry: ${{ env.QUAY_ORG }}
71+
username: ${{ secrets.QUAY_INSIGHTS_ONPREM_ROBOT_USERNAME }}
72+
password: ${{ secrets.QUAY_INSIGHTS_ONPREM_ROBOT_PASSWORD }}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Koku UI OnPrem - Push tag
2+
3+
on:
4+
push:
5+
tags:
6+
- "onprem-*"
7+
8+
jobs:
9+
call-shared:
10+
uses: ./.github/workflows/koku-ui-onprem-push-shared.yml
11+
with:
12+
ref_type: "tag"

0 commit comments

Comments
 (0)