From 37ad838a1f4bf20d4661677b5177247be56110ff Mon Sep 17 00:00:00 2001 From: Jonathan Cremin Date: Sat, 17 May 2025 19:26:35 +0100 Subject: [PATCH] Add workflows --- .forgejo/workflows/build-image.yaml | 78 +++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .forgejo/workflows/build-image.yaml diff --git a/.forgejo/workflows/build-image.yaml b/.forgejo/workflows/build-image.yaml new file mode 100644 index 0000000..23e21fe --- /dev/null +++ b/.forgejo/workflows/build-image.yaml @@ -0,0 +1,78 @@ +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: Echo current date + run: echo $NOW + - 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 + - name: Build image + 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 + 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: Echo current date + run: echo $NOW + - 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 + - name: Build image + 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 + 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 + tags: 42 latest 42-${{ env.NOW }} \ No newline at end of file