Skip to content

Commit f9c0986

Browse files
authored
Merge pull request #2 from projectbluefin/add-container-build
Add container build workflow
2 parents d13f1f8 + 36068f6 commit f9c0986

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed

.github/workflows/build-common.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Build Common Files
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
push:
7+
branches:
8+
- main
9+
workflow_dispatch:
10+
11+
env:
12+
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
13+
IMAGE_NAME: bluefin-common
14+
15+
jobs:
16+
build_push:
17+
name: Build and push image
18+
runs-on: ubuntu-24.04
19+
permissions:
20+
contents: read
21+
packages: write
22+
id-token: write
23+
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
27+
28+
- name: Lowercase Registry
29+
id: registry_case
30+
uses: ASzc/change-string-case-action@d0603cd0a7dd490be678164909f65c7737470a7f # v6
31+
with:
32+
string: ${{ env.IMAGE_REGISTRY }}
33+
34+
- name: Generate Image Metadata
35+
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5
36+
id: meta
37+
with:
38+
images: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}
39+
tags: |
40+
type=raw,value=latest
41+
42+
- name: Login to GitHub Container Registry
43+
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3
44+
if: github.event_name != 'pull_request'
45+
with:
46+
registry: ghcr.io
47+
username: ${{ github.actor }}
48+
password: ${{ secrets.GITHUB_TOKEN }}
49+
50+
- name: Build and Push Image
51+
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
52+
id: build
53+
with:
54+
context: .
55+
file: ./Containerfile
56+
push: ${{ github.event_name != 'pull_request' }}
57+
tags: ${{ steps.meta.outputs.tags }}
58+
labels: ${{ steps.meta.outputs.labels }}
59+
60+
# - name: Install Cosign
61+
# uses: sigstore/cosign-installer@7e8b541eb2e61bf99390e1afd4be13a184e9ebc5 # v3.10.1
62+
# if: github.event_name != 'pull_request'
63+
64+
# - name: Sign container image
65+
# if: github.event_name != 'pull_request'
66+
# run: |
67+
# cosign sign -y --key env://COSIGN_PRIVATE_KEY ${{ steps.registry_case.outputs.lowercase }}/${{ env.IMAGE_NAME }}@${{ steps.build.outputs.digest }}
68+
# env:
69+
# COSIGN_EXPERIMENTAL: false
70+
# COSIGN_PRIVATE_KEY: ${{ secrets.SIGNING_SECRET }}

cosign.pub

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-----BEGIN PUBLIC KEY-----
2+
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEHLRpBfPRYiMl9wb7s6fx47PzzNWu
3+
3zyJgXhWEvxoOgwv9CpwjbvUwR9qHxNMWkJhuGE6cjDA2hpy1I6NbA+24Q==
4+
-----END PUBLIC KEY-----

0 commit comments

Comments
 (0)