Skip to content

Commit a663511

Browse files
ci: continuous image generation in github registry (#31)
Signed-off-by: Carlos Feria <[email protected]>
1 parent bcce6f1 commit a663511

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed

.github/workflows/image-build.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Multiple Architecture Image Build
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- "main"
8+
- "release/*"
9+
tags:
10+
- "v*"
11+
12+
concurrency:
13+
group: build-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
image-build:
18+
uses: securesign/rhtas-console-ui/.github/workflows/build-push-images.yaml@main
19+
with:
20+
registry: "ghcr.io"
21+
image_name: "${{ github.repository_owner }}/rhtas-console"
22+
containerfile: "./Dockerfile"
23+
architectures: '[ "amd64", "arm64" ]'
24+
extra-args: "--ulimit nofile=4096:4096"
25+
secrets:
26+
registry_username: ${{ github.actor }}
27+
registry_password: ${{ secrets.GITHUB_TOKEN }}
28+
29+
attestations:
30+
needs: image-build
31+
runs-on: ubuntu-latest
32+
permissions:
33+
id-token: write
34+
contents: read
35+
attestations: write
36+
packages: write
37+
steps:
38+
- name: Log in to registry
39+
uses: redhat-actions/podman-login@4934294ad0449894bcd1e9f191899d7292469603 #v1
40+
with:
41+
username: ${{ github.actor }}
42+
password: ${{ secrets.GITHUB_TOKEN }}
43+
registry: ghcr.io
44+
- name: Generate artifact attestation
45+
uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3
46+
with:
47+
subject-name: ghcr.io/${{ github.repository_owner }}/rhtas-console
48+
subject-digest: ${{ needs.image-build.outputs.digest }}
49+
push-to-registry: true
50+

Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Build stage
2+
FROM golang:1.25 AS builder
3+
4+
WORKDIR /app
5+
6+
COPY . .
7+
8+
RUN go build -buildvcs=false -o rhtas_console ./cmd/rhtas_console
9+
10+
# Final stage
11+
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.6
12+
13+
# Set a writable working directory
14+
WORKDIR /tmp
15+
ENV HOME=/tmp
16+
17+
COPY --from=builder /app/rhtas_console /tmp/rhtas_console
18+
COPY internal/db/migrations /tmp/internal/db/migrations
19+
20+
USER 65532:65532
21+
22+
# Expose API port
23+
EXPOSE 8080
24+
25+
#ENTRYPOINT
26+
ENTRYPOINT ["/tmp/rhtas_console"]

0 commit comments

Comments
 (0)