bootc/.forgejo/workflows/ci.yaml
Jonathan Cremin fd1dd297df
All checks were successful
ci / workstation (push) Successful in 12m51s
ci / workstation-nvidia (push) Successful in 16m9s
Check speed of builds without committing layers
2025-06-15 22:41:10 +01:00

108 lines
4.5 KiB
YAML

name: ci
on:
push:
branches: [main]
schedule:
- cron: "0 6 * * *"
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: ${{ vars.FORGEJO_REGISTRY_USER }}
password: ${{ secrets.FORGEJO_REGISTRY_TOKEN }}
auth_file_path: /run/user/1001/containers/auth.json
- name: Check out repository
uses: https://cremin.dev/actions/checkout@v4
- name: Get commit message
id: commit_message
run: |
echo "message=$(git log -1 --pretty=%B)" >> $GITHUB_OUTPUT
- name: Check if workstation was changed
if: ${{ github.event_name != 'schedule' }}
uses: https://cremin.dev/actions/paths-filter@v3
id: changes
with:
filters: |
src:
- 'workstation/**'
- name: Fetch latest image
if: github.event_name == 'schedule' || steps.changes.outputs.src == 'true' || grep -q '!force' ${{ steps.commit_message.outputs.message }}
run: |
podman pull ghcr.io/ublue-os/silverblue-main:42
- name: Build image
if: github.event_name == 'schedule' || steps.changes.outputs.src == 'true' || grep -q '!force' ${{ steps.commit_message.outputs.message }}
uses: https://cremin.dev/actions/buildah-build@v2
with:
containerfiles: ./workstation/Containerfile
context: ./workstation
oci: true
image: cremin.dev/jonathan/ublue-silverblue-main
tags: 42 latest 42-${{ env.NOW }}
- name: Push image
if: github.event_name == 'schedule' || steps.changes.outputs.src == 'true' || grep -q '!force' ${{ steps.commit_message.outputs.message }}
uses: https://cremin.dev/actions/push-to-registry@v2
with:
registry: cremin.dev
username: ${{ vars.FORGEJO_REGISTRY_USER }}
password: ${{ secrets.FORGEJO_REGISTRY_TOKEN }}
image: jonathan/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: ${{ vars.FORGEJO_REGISTRY_USER }}
password: ${{ secrets.FORGEJO_REGISTRY_TOKEN }}
auth_file_path: /run/user/1001/containers/auth.json
- name: Check out repository
uses: https://cremin.dev/actions/checkout@v4
- name: Get commit message
id: commit_message
run: |
echo "message=$(git log -1 --pretty=%B)" >> $GITHUB_OUTPUT
- name: Check if workstation-nvidia was changed
if: ${{ github.event_name != 'schedule' }}
uses: https://cremin.dev/actions/paths-filter@v3
id: changes
with:
filters: |
src:
- 'workstation-nvidia/**'
- name: Fetch latest image
if: github.event_name == 'schedule' || steps.changes.outputs.src == 'true' || grep -q '!force' ${{ steps.commit_message.outputs.message }}
run: |
podman pull ghcr.io/ublue-os/silverblue-main:42
- name: Build image
if: github.event_name == 'schedule' || steps.changes.outputs.src == 'true' || grep -q '!force' ${{ steps.commit_message.outputs.message }}
uses: https://cremin.dev/actions/buildah-build@v2
with:
containerfiles: ./workstation-nvidia/Containerfile
context: ./workstation-nvidia
image: cremin.dev/jonathan/ublue-silverblue-nvidia
tags: 42 latest 42-${{ env.NOW }}
- name: Push image
if: github.event_name == 'schedule' || steps.changes.outputs.src == 'true' || grep -q '!force' ${{ steps.commit_message.outputs.message }}
uses: https://cremin.dev/actions/push-to-registry@v2
with:
registry: cremin.dev
username: ${{ vars.FORGEJO_REGISTRY_USER }}
password: ${{ secrets.FORGEJO_REGISTRY_TOKEN }}
image: jonathan/ublue-silverblue-nvidia
tags: 42 latest 42-${{ env.NOW }}