Skip to content

Commit 5e876c6

Browse files
add github workflow for feature-alert-channels branch
1 parent 0cc4347 commit 5e876c6

1 file changed

Lines changed: 122 additions & 0 deletions

File tree

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
name: Build and Push Docker Images (Feature Alert Channels)
2+
3+
on:
4+
push:
5+
branches:
6+
- feature-alert-channels
7+
paths:
8+
- 'dashboard/**'
9+
- 'src/**'
10+
- '.github/workflows/build-and-push-feature-alert-channels.yml'
11+
tags:
12+
- 'v*.*.*'
13+
pull_request:
14+
branches:
15+
- feature-alert-channels
16+
paths:
17+
- 'dashboard/**'
18+
- 'src/**'
19+
- '.github/workflows/build-and-push-feature-alert-channels.yml'
20+
workflow_dispatch:
21+
22+
concurrency:
23+
group: ${{ github.workflow }}-${{ github.ref }}
24+
cancel-in-progress: true
25+
26+
env:
27+
REGISTRY: ghcr.io
28+
CORE_IMAGE_NAME: ${{ github.repository_owner }}/simplens-core-feat-alt-ch
29+
DASHBOARD_IMAGE_NAME: ${{ github.repository_owner }}/simplens-dashboard-feat-alt-ch
30+
31+
jobs:
32+
build-core:
33+
runs-on: ubuntu-latest
34+
permissions:
35+
contents: read
36+
packages: write
37+
38+
steps:
39+
- name: Checkout repository
40+
uses: actions/checkout@v4
41+
42+
- name: Set up Docker Buildx
43+
uses: docker/setup-buildx-action@v3
44+
45+
- name: Log in to Container Registry
46+
if: github.event_name != 'pull_request'
47+
uses: docker/login-action@v3
48+
with:
49+
registry: ${{ env.REGISTRY }}
50+
username: ${{ github.actor }}
51+
password: ${{ secrets.GITHUB_TOKEN }}
52+
53+
- name: Extract metadata for simplens-core-feat-alt-ch
54+
id: meta-core
55+
uses: docker/metadata-action@v5
56+
with:
57+
images: ${{ env.REGISTRY }}/${{ env.CORE_IMAGE_NAME }}
58+
tags: |
59+
type=ref,event=branch
60+
type=ref,event=pr
61+
type=semver,pattern={{version}}
62+
type=semver,pattern={{major}}.{{minor}}
63+
type=sha,prefix=
64+
type=raw,value=latest,enable={{is_default_branch}}
65+
66+
- name: Build and push simplens-core-feat-alt-ch
67+
uses: docker/build-push-action@v6
68+
with:
69+
context: .
70+
file: ./Dockerfile
71+
push: ${{ github.event_name != 'pull_request' }}
72+
tags: ${{ steps.meta-core.outputs.tags }}
73+
labels: ${{ steps.meta-core.outputs.labels }}
74+
cache-from: type=gha,scope=core-feat-alt-ch
75+
cache-to: type=gha,mode=max,scope=core-feat-alt-ch
76+
platforms: linux/amd64
77+
78+
build-dashboard:
79+
runs-on: ubuntu-latest
80+
permissions:
81+
contents: read
82+
packages: write
83+
84+
steps:
85+
- name: Checkout repository
86+
uses: actions/checkout@v4
87+
88+
- name: Set up Docker Buildx
89+
uses: docker/setup-buildx-action@v3
90+
91+
- name: Log in to Container Registry
92+
if: github.event_name != 'pull_request'
93+
uses: docker/login-action@v3
94+
with:
95+
registry: ${{ env.REGISTRY }}
96+
username: ${{ github.actor }}
97+
password: ${{ secrets.GITHUB_TOKEN }}
98+
99+
- name: Extract metadata for simplens-dashboard-feat-alt-ch
100+
id: meta-dashboard
101+
uses: docker/metadata-action@v5
102+
with:
103+
images: ${{ env.REGISTRY }}/${{ env.DASHBOARD_IMAGE_NAME }}
104+
tags: |
105+
type=ref,event=branch
106+
type=ref,event=pr
107+
type=semver,pattern={{version}}
108+
type=semver,pattern={{major}}.{{minor}}
109+
type=sha,prefix=
110+
type=raw,value=latest,enable={{is_default_branch}}
111+
112+
- name: Build and push simplens-dashboard-feat-alt-ch
113+
uses: docker/build-push-action@v6
114+
with:
115+
context: ./dashboard
116+
file: ./dashboard/Dockerfile
117+
push: ${{ github.event_name != 'pull_request' }}
118+
tags: ${{ steps.meta-dashboard.outputs.tags }}
119+
labels: ${{ steps.meta-dashboard.outputs.labels }}
120+
cache-from: type=gha,scope=dashboard-feat-alt-ch
121+
cache-to: type=gha,mode=max,scope=dashboard-feat-alt-ch
122+
platforms: linux/amd64

0 commit comments

Comments
 (0)