Skip to content

Commit e74dfbd

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

File tree

4 files changed

+156
-1
lines changed

4 files changed

+156
-1
lines changed

.github/workflows/deck.yaml

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
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: free space
71+
run: |
72+
cd /opt
73+
find . -maxdepth 1 -mindepth 1 '!' -path ./containerd '!' -path ./actionarchivecache '!' -path ./runner '!' -path ./runner-cache -exec rm -rf '{}' ';'
74+
75+
- name: build image
76+
id: build_image
77+
uses: redhat-actions/buildah-build@7a95fa7ee0f02d552a32753e7414641a04307056 # v2
78+
with:
79+
containerfiles: |
80+
./Containerfile.deck
81+
image: ${{ env.IMAGE_NAME }}
82+
tags: ${{ steps.metadata.outputs.tags }}
83+
labels: ${{ steps.metadata.outputs.labels }}
84+
oci: false
85+
86+
- name: ghcr login
87+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3
88+
if: github.event_name != 'pull_request' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
89+
with:
90+
registry: ghcr.io
91+
username: ${{ github.actor }}
92+
password: ${{ secrets.GITHUB_TOKEN }}
93+
94+
- name: push image
95+
uses: redhat-actions/push-to-registry@5ed88d269cf581ea9ef6dd6806d01562096bee9c # v2
96+
if: github.event_name != 'pull_request' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
97+
id: push
98+
env:
99+
REGISTRY_USER: ${{ github.actor }}
100+
REGISTRY_PASSWORD: ${{ github.token }}
101+
with:
102+
registry: ${{ env.IMAGE_REGISTRY }}
103+
image: ${{ env.IMAGE_NAME }}
104+
tags: ${{ steps.metadata.outputs.tags }}
105+
username: ${{ env.REGISTRY_USER }}
106+
password: ${{ env.REGISTRY_PASSWORD }}
107+
108+
- name: install cosign
109+
uses: sigstore/cosign-installer@d7543c93d881b35a8faa02e8e3605f69b7a1ce62 # v3.10.0
110+
if: github.event_name != 'pull_request' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
111+
112+
- name: sign image
113+
if: github.event_name != 'pull_request' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
114+
run: |
115+
IMAGE_FULL="${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}"
116+
cosign sign -y --key env://COSIGN_PRIVATE_KEY "$IMAGE_FULL@$DIGEST"
117+
env:
118+
DIGEST: ${{ steps.push.outputs.digest }}
119+
COSIGN_EXPERIMENTAL: false
120+
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)