Skip to content

Commit 727d250

Browse files
authored
Merge branch 'main' into fix-helm-chart
2 parents cc7cc71 + fcaf852 commit 727d250

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

.github/workflows/build-image.yaml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Build Image
2+
run-name: Build Container and Helm Chart from ${{github.ref_name}} by @${{ github.actor }}
3+
4+
on: workflow_dispatch
5+
6+
env:
7+
REGISTRY: ghcr.io
8+
IMAGE_NAME: ${{ github.repository }}
9+
10+
jobs:
11+
build_image:
12+
name: Build Docker Image and Helm Charts
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
packages: write
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Log in to the Container registry
24+
uses: docker/[email protected]
25+
with:
26+
registry: ${{ env.REGISTRY }}
27+
username: ${{ github.actor }}
28+
password: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: Get project version
31+
uses: SneaksAndData/github-actions/[email protected]
32+
id: version
33+
34+
- name: Get build number
35+
shell: bash
36+
id: buildnumber
37+
run: |
38+
dt=$(date +'%Y%m%d%H%M%S')
39+
echo "result=$dt" >> "$GITHUB_OUTPUT"
40+
41+
- name: Extract metadata (tags, labels) for Docker
42+
id: meta
43+
uses: docker/metadata-action@v5
44+
with:
45+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
46+
tags: |
47+
type=semver,pattern={{version}},value=${{steps.version.outputs.version}}
48+
flavor:
49+
latest=false
50+
51+
- name: Set up Docker Buildx
52+
uses: docker/[email protected]
53+
with:
54+
use: true
55+
platforms: linux/arm64,linux/amd64
56+
57+
- name: Build and push Docker image
58+
uses: docker/[email protected]
59+
with:
60+
context: .
61+
build-args: |
62+
APPVERSION=${{ steps.version.outputs.version }}
63+
BUILDNUMBER=${{ steps.buildnumber.outputs.result }}
64+
file: .container/Dockerfile
65+
push: true
66+
tags: ${{ steps.meta.outputs.tags }}
67+
labels: ${{ steps.meta.outputs.labels }}
68+
platforms: linux/arm64,linux/amd64
69+
70+
- name: Build and Push Chart
71+
uses: SneaksAndData/github-actions/[email protected]
72+
with:
73+
application: nexus
74+
app_version: ${{ steps.meta.outputs.version }}
75+
container_registry_user: ${{ github.actor }}
76+
container_registry_token: ${{ secrets.GITHUB_TOKEN }}
77+
container_registry_address: ghcr.io/sneaksanddata/

0 commit comments

Comments
 (0)