Skip to content

Commit 72e50f2

Browse files
committed
feat: add custom bazzite image
1 parent 7f07ae7 commit 72e50f2

File tree

4 files changed

+151
-1
lines changed

4 files changed

+151
-1
lines changed

.github/workflows/deck.yaml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
---
2+
name: deck image
3+
4+
on:
5+
schedule:
6+
- cron: '0 3 * * *'
7+
push:
8+
branches: ["main"]
9+
paths:
10+
- Containerfile.deck
11+
- build/**
12+
- system/**
13+
14+
env:
15+
DEFAULT_TAG: "latest"
16+
IMAGE_NAME: ${{ github.event.repository.name }}-deck
17+
IMAGE_DESC: "Customized image of bazzite"
18+
IMAGE_REGISTRY: "ghcr.io/${{ github.repository_owner }}"
19+
REGISTRY: ghcr.io
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-24.04
24+
permissions:
25+
contents: read
26+
packages: write
27+
id-token: write
28+
29+
steps:
30+
- name: prepare environment
31+
run: |
32+
echo "IMAGE_REGISTRY=${IMAGE_REGISTRY,,}" >> "${GITHUB_ENV}"
33+
echo "IMAGE_NAME=${IMAGE_NAME,,}" >> "${GITHUB_ENV}"
34+
35+
- name: checkout
36+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
37+
38+
- name: mount btrfs for podman storage
39+
id: container-storage-action
40+
uses: ublue-os/container-storage-action@911baca08baf30c8654933e9e9723cb399892140
41+
continue-on-error: true
42+
with:
43+
target-dir: /var/lib/containers
44+
mount-opts: compress-force=zstd:2
45+
46+
- name: get current date
47+
id: date
48+
run: |
49+
# shellcheck disable=SC1001
50+
echo "date=$(date -u +%Y\-%m\-%d\T%H\:%M\:%S\Z)" >> "${GITHUB_OUTPUT}"
51+
52+
- name: metadata
53+
uses: docker/metadata-action@318604b99e75e41977312d83839a89be02ca4893 # v5
54+
id: metadata
55+
with:
56+
tags: |
57+
type=schedule,pattern={{date 'YYYYMMDD'}}
58+
type=raw,value=latest
59+
labels: |
60+
org.opencontainers.image.created=${{ steps.date.outputs.date }}
61+
org.opencontainers.image.description=${{ env.IMAGE_DESC }}
62+
org.opencontainers.image.documentation=https://raw.githubusercontent.com/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}/${{ github.sha }}/README.md
63+
org.opencontainers.image.source=https://github.com/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}/blob/${{ github.sha }}/Containerfile.deck
64+
org.opencontainers.image.title=${{ env.IMAGE_NAME }}
65+
org.opencontainers.image.url=https://github.com/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}/tree/${{ github.sha }}
66+
org.opencontainers.image.vendor=${{ github.repository_owner }}
67+
org.opencontainers.image.licenses=MIT
68+
containers.bootc=1
69+
70+
- name: build image
71+
id: build_image
72+
uses: redhat-actions/buildah-build@7a95fa7ee0f02d552a32753e7414641a04307056 # v2
73+
with:
74+
containerfiles: |
75+
./Containerfile.deck
76+
image: ${{ env.IMAGE_NAME }}
77+
tags: ${{ steps.metadata.outputs.tags }}
78+
labels: ${{ steps.metadata.outputs.labels }}
79+
oci: false
80+
81+
- name: ghcr login
82+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3
83+
if: github.event_name != 'pull_request' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
84+
with:
85+
registry: ghcr.io
86+
username: ${{ github.actor }}
87+
password: ${{ secrets.GITHUB_TOKEN }}
88+
89+
- name: push image
90+
uses: redhat-actions/push-to-registry@5ed88d269cf581ea9ef6dd6806d01562096bee9c # v2
91+
if: github.event_name != 'pull_request' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
92+
id: push
93+
env:
94+
REGISTRY_USER: ${{ github.actor }}
95+
REGISTRY_PASSWORD: ${{ github.token }}
96+
with:
97+
registry: ${{ env.IMAGE_REGISTRY }}
98+
image: ${{ env.IMAGE_NAME }}
99+
tags: ${{ steps.metadata.outputs.tags }}
100+
username: ${{ env.REGISTRY_USER }}
101+
password: ${{ env.REGISTRY_PASSWORD }}
102+
103+
- name: install cosign
104+
uses: sigstore/cosign-installer@d7543c93d881b35a8faa02e8e3605f69b7a1ce62 # v3.10.0
105+
if: github.event_name != 'pull_request' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
106+
107+
- name: sign image
108+
if: github.event_name != 'pull_request' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
109+
run: |
110+
IMAGE_FULL="${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}"
111+
cosign sign -y --key env://COSIGN_PRIVATE_KEY "$IMAGE_FULL@$DIGEST"
112+
env:
113+
DIGEST: ${{ steps.push.outputs.digest }}
114+
COSIGN_EXPERIMENTAL: false
115+
COSIGN_PRIVATE_KEY: ${{ secrets.SIGNING_SECRET }}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: image
2+
name: desktop image
33

44
on:
55
schedule:

Containerfile.deck

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FROM scratch AS ctx
2+
COPY /system /sys_files
3+
COPY /build /
4+
COPY cosign.pub /cosign.pub
5+
6+
FROM ghcr.io/ublue-os/bazzite-deck:stable
7+
8+
ARG IMAGE_NAME="kinokite-deck"
9+
ARG IMAGE_VENDOR="clemak27"
10+
11+
RUN mkdir -p /var/lib/alternatives
12+
13+
RUN --mount=type=bind,from=ctx,src=/,dst=/ctx \
14+
--mount=type=cache,target=/var/cache \
15+
--mount=type=cache,target=/var/log \
16+
--mount=type=tmpfs,target=/tmp \
17+
dnf -y install podman-docker zsh && \
18+
dnf -y remove ptyxis && \
19+
mkdir -p /etc/containers && \
20+
touch /etc/containers/nodocker && \
21+
systemctl enable podman.socket && \
22+
sed -i 's@/bin/bash@/bin/zsh@g' /etc/default/useradd && \
23+
mkdir -p /etc/pki/containers && \
24+
cp /ctx/cosign.pub /etc/pki/containers/clemak27.pub && \
25+
restorecon -RFv /etc/pki/containers && \
26+
restorecon -RFv /etc/containers && \
27+
/ctx/1_plasma.sh && \
28+
/ctx/9_cleanup.sh && \
29+
ostree container commit && \
30+
bootc container lint

mise.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,8 @@ shellcheck plasma.sh
2020
run = """
2121
docker build -t ${IMAGE_NAME}:${IMAGE_TAG} .
2222
"""
23+
24+
[tasks.build-image-deck]
25+
run = """
26+
docker build -t ${IMAGE_NAME}-deck:${IMAGE_TAG} -f ./Containerfile.deck .
27+
"""

0 commit comments

Comments
 (0)