Skip to content

Commit 0dbc345

Browse files
committed
feat: dockerfile and github action updates
1 parent 1e91fa8 commit 0dbc345

2 files changed

Lines changed: 45 additions & 118 deletions

File tree

.github/workflows/build-and-release.yml

Lines changed: 39 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ on:
1313
- '*.md'
1414
- '*.png'
1515
- '*.txt'
16+
1617
push:
1718
branches:
1819
- master
@@ -21,6 +22,7 @@ on:
2122
- '*.md'
2223
- '*.png'
2324
- '*.txt'
25+
2426
workflow_dispatch:
2527

2628
env:
@@ -29,6 +31,7 @@ env:
2931
REGISTRY_USERNAME: ${{ github.repository_owner }}
3032
REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
3133

34+
3235
jobs:
3336
build:
3437
runs-on: ubuntu-latest
@@ -39,15 +42,8 @@ jobs:
3942
strategy:
4043
fail-fast: false
4144
matrix:
42-
major_version: [41]
43-
include:
44-
- major_version: 41
45-
is_latest: true
46-
is_stable: true
47-
# - major_version: 39
48-
# is_latest: false
49-
# is_stable: false
50-
45+
fedora_version:
46+
- 41
5147
steps:
5248
- name: Checkout repository
5349
uses: actions/checkout@v3
@@ -59,107 +55,40 @@ jobs:
5955
username: ${{ env.REGISTRY_USERNAME }}
6056
password: ${{ env.REGISTRY_PASSWORD }}
6157

62-
- name: Extract Docker metadata
63-
id: meta
64-
uses: docker/metadata-action@v4
65-
with:
66-
images: |
67-
${{ env.REGISTRY_URL }}/${{ env.REGISTRY_USERNAME }}/${{ env.IMAGE_NAME }}
68-
flavor: |
69-
latest=false
70-
tags: |
71-
type=semver,pattern={{version}}
72-
type=sha,prefix=sha256-
73-
74-
- name: Extract Docker PR tag
75-
if: github.event_name == 'pull_request'
76-
id: meta_pr
77-
uses: docker/metadata-action@v4
78-
with:
79-
images: |
80-
${{ env.REGISTRY_URL }}/${{ env.REGISTRY_USERNAME }}/${{ env.IMAGE_NAME }}
81-
flavor: |
82-
latest=false
83-
tags: |
84-
type=ref,suffix=-${{ matrix.major_version }},event=pr
85-
86-
- name: Extract Docker date tag
87-
if: github.event_name == 'schedule'
88-
id: meta_date
89-
uses: docker/metadata-action@v4
90-
with:
91-
images: |
92-
${{ env.REGISTRY_URL }}/${{ env.REGISTRY_USERNAME }}/${{ env.IMAGE_NAME }}
93-
flavor: |
94-
latest=false
95-
tags: |
96-
type=schedule,prefix=${{ matrix.major_version }}-,pattern={{date 'YYYYMMDD'}}
97-
98-
- name: Extract Docker major version tag
99-
if: |
100-
github.event_name != 'pull_request' && matrix.major_version != ''
101-
id: meta_version
102-
uses: docker/metadata-action@v4
103-
with:
104-
images: |
105-
${{ env.REGISTRY_URL }}/${{ env.REGISTRY_USERNAME }}/${{ env.IMAGE_NAME }}
106-
flavor: |
107-
latest=false
108-
tags: |
109-
type=raw,value=${{ matrix.major_version }}
110-
111-
- name: Extract Docker stable tag
112-
if: |
113-
github.event_name != 'pull_request' && matrix.is_stable == true
114-
id: meta_stable
115-
uses: docker/metadata-action@v4
116-
with:
117-
images: |
118-
${{ env.REGISTRY_URL }}/${{ env.REGISTRY_USERNAME }}/${{ env.IMAGE_NAME }}
119-
flavor: |
120-
latest=false
121-
tags: |
122-
type=schedule,pattern={{date 'YYYYMMDD'}}
123-
type=raw,value=stable
124-
125-
- name: Extract Docker latest tag
126-
if: |
127-
github.event_name != 'pull_request' && matrix.is_latest == true
128-
id: meta_latest
129-
uses: docker/metadata-action@v4
130-
with:
131-
images: |
132-
${{ env.REGISTRY_URL }}/${{ env.REGISTRY_USERNAME }}/${{ env.IMAGE_NAME }}
133-
flavor: |
134-
latest=false
135-
tags: |
136-
type=raw,value=latest
137-
138-
- name: Build Image
58+
- name: Build Image with podman
13959
id: build_image
140-
uses: redhat-actions/buildah-build@v2
141-
with:
142-
containerfiles: |
143-
./Containerfile
144-
tags: |
145-
${{ steps.meta.outputs.tags }}
146-
${{ steps.meta_pr.outputs.tags }}
147-
${{ steps.meta_date.outputs.tags }}
148-
${{ steps.meta_version.outputs.tags }}
149-
${{ steps.meta_stable.outputs.tags }}
150-
${{ steps.meta_latest.outputs.tags }}
151-
labels: ${{ steps.meta.outputs.labels }}
152-
build-args: |
153-
FEDORA_MAJOR_VERSION=${{ matrix.major_version }}
154-
oci: false
155-
156-
- name: Push to container registries
157-
uses: redhat-actions/push-to-registry@v2
158-
id: push
159-
with:
160-
tags: ${{ steps.build_image.outputs.tags }}
161-
extra-args: |
162-
--disable-content-trust
60+
shell: bash
61+
env:
62+
IMAGE: "ghcr.io/${{ github.repository}}:${{matrix.fedora_version}}"
63+
run: |+
64+
podman build -t $IMAGE -f ./Containerfile . --build-arg FEDORA_VERSION=${{ matrix.fedora_version }}
65+
podman push $IMAGE
66+
67+
# - name: Build Image
68+
# id: build_image
69+
# uses: redhat-actions/buildah-build@v2
70+
# with:
71+
# containerfiles: |
72+
# ./Containerfile
73+
# tags: |
74+
# ${{ steps.meta.outputs.tags }}
75+
# ${{ steps.meta_pr.outputs.tags }}
76+
# ${{ steps.meta_date.outputs.tags }}
77+
# ${{ steps.meta_version.outputs.tags }}
78+
# ${{ steps.meta_stable.outputs.tags }}
79+
# ${{ steps.meta_latest.outputs.tags }}
80+
# labels: ${{ steps.meta.outputs.labels }}
81+
# build-args: |
82+
# FEDORA_MAJOR_VERSION=${{ matrix.major_version }}
83+
# oci: false
84+
85+
# - name: Push to container registries
86+
# uses: redhat-actions/push-to-registry@v2
87+
# id: push
88+
# with:
89+
# tags: ${{ steps.build_image.outputs.tags }}
90+
# extra-args: |
91+
# --disable-content-trust
16392

16493
# - name: Install Cosign
16594
# uses: sigstore/cosign-installer@v3.1.2
@@ -174,4 +103,4 @@ jobs:
174103

175104
- name: Echo outputs
176105
run: |
177-
echo "${{ toJSON(steps.push.outputs) }}"
106+
echo "IMAGE: ghcr.io/${{ github.repository}}:${{matrix.fedora_version}}"

Containerfile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
ARG FEDORA_MAJOR_VERSION=41
1+
ARG FEDORA_VERSION=41
22

3-
# FROM quay.io/fedora-ostree-desktops/silverblue:${FEDORA_MAJOR_VERSION}
4-
FROM ghcr.io/ublue-os/silverblue-asus-nvidia:${FEDORA_MAJOR_VERSION}
5-
ARG FEDORA_MAJOR_VERSION
6-
RUN sed -i "s|^NAME=.*|NAME=nxtcoder17 edition silverblue ${FEDORA_MAJOR_VERSION}|" /usr/lib/os-release
7-
RUN sed -i "s|^PRETTY_NAME=.*|PRETTY_NAME=nxtcoder17 edition silverblue ${FEDORA_MAJOR_VERSION}|" /usr/lib/os-release
3+
FROM ghcr.io/ublue-os/silverblue-asus-nvidia:${FEDORA_VERSION}
4+
ARG FEDORA_VERSION
5+
RUN sed -i "s|^NAME=.*|NAME=nxtcoder17 edition silverblue ${FEDORA_VERSION}|" /usr/lib/os-release
6+
RUN sed -i "s|^PRETTY_NAME=.*|PRETTY_NAME=nxtcoder17 edition silverblue ${FEDORA_VERSION}|" /usr/lib/os-release
87

98
RUN rpm-ostree override remove firefox firefox-langpacks
10-
RUN rpm-ostree install kitty distrobox picom docker wayfire hyprland
11-
# RUN rpm-ostree install kitty distrobox picom docker xorg-x11-server-Xephyr
9+
RUN rpm-ostree install kitty distrobox docker wayfire hyprland
1210
RUN rpm-ostree cleanup -m && ostree container commit

0 commit comments

Comments
 (0)