bootc/.forgejo/workflows/build-image.yaml

93 lines
3.1 KiB
YAML
Raw Permalink Normal View History

2025-05-17 19:26:35 +01:00
name: ci
on:
push:
branches: main
schedule:
- cron: "0 7 * * *"
jobs:
workstation:
runs-on: self-hosted
steps:
- name: Set current date as env variable
run: echo "NOW=$(date +'%Y%m%d-%H%M%S')" >> $GITHUB_ENV
- name: Fix for bad os check
run: echo "RUNNER_OS=Linux" >> $GITHUB_ENV
- name: Login to Forgejo Registry
uses: https://cremin.dev/actions/podman-login@v1
with:
registry: cremin.dev
username: ${{ github.actor }}
password: ${{ secrets.FORGEJO_REGISTRY_TOKEN }}
- name: Check out repository
uses: https://cremin.dev/actions/checkout@v4
2025-05-20 10:33:17 +01:00
- name: Check if workstation was changed
uses: https://cremin.dev/actions/paths-filter@v3
id: changes
with:
filters: |
src:
- 'workstation/**'
2025-05-17 19:26:35 +01:00
- name: Build image
2025-05-20 10:33:17 +01:00
if: steps.changes.outputs.src == 'true'
2025-05-17 19:26:35 +01:00
uses: https://cremin.dev/actions/buildah-build@v2
with:
containerfiles: ./workstation/Containerfile
context: ./workstation
oci: true
layers: true
image: cremin.dev/jonathan/ublue-silverblue-main
tags: 42 latest 42-${{ env.NOW }}
- name: Push image
2025-05-20 10:33:17 +01:00
if: steps.changes.outputs.src == 'true'
2025-05-17 19:26:35 +01:00
uses: https://cremin.dev/actions/push-to-registry@v2
with:
registry: cremin.dev/jonathan
username: ${{ github.actor }}
password: ${{ secrets.FORGEJO_REGISTRY_TOKEN }}
image: ublue-silverblue-main
tags: 42 latest 42-${{ env.NOW }}
workstation-nvidia:
runs-on: self-hosted
steps:
- name: Set current date as env variable
run: echo "NOW=$(date +'%Y%m%d-%H%M%S')" >> $GITHUB_ENV
- name: Fix for bad os check
run: echo "RUNNER_OS=Linux" >> $GITHUB_ENV
- name: Login to Forgejo Registry
uses: https://cremin.dev/actions/podman-login@v1
with:
registry: cremin.dev
username: ${{ github.actor }}
password: ${{ secrets.FORGEJO_REGISTRY_TOKEN }}
- name: Check out repository
uses: https://cremin.dev/actions/checkout@v4
2025-05-20 10:33:17 +01:00
- name: Check if workstation-nvidia was changed
uses: https://cremin.dev/actions/paths-filter@v3
id: changes
with:
filters: |
src:
- 'workstation-nvidia/**'
2025-05-17 19:26:35 +01:00
- name: Build image
2025-05-20 10:33:17 +01:00
if: steps.changes.outputs.src == 'true'
2025-05-17 19:26:35 +01:00
uses: https://cremin.dev/actions/buildah-build@v2
with:
containerfiles: ./workstation-nvidia/Containerfile
context: ./workstation-nvidia
oci: true
layers: true
image: cremin.dev/jonathan/ublue-silverblue-nvidia
tags: 42 latest 42-${{ env.NOW }}
- name: Push image
2025-05-20 10:33:17 +01:00
if: steps.changes.outputs.src == 'true'
2025-05-17 19:26:35 +01:00
uses: https://cremin.dev/actions/push-to-registry@v2
with:
registry: cremin.dev/jonathan
username: ${{ github.actor }}
password: ${{ secrets.FORGEJO_REGISTRY_TOKEN }}
image: ublue-silverblue-nvidia
2025-05-18 17:13:30 +01:00
tags: 42 latest 42-${{ env.NOW }}
2025-05-20 10:33:17 +01:00