2024-07-20 19:38:21 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
2024-07-20 20:57:13 +00:00
|
|
|
- "*-v*"
|
2024-11-07 00:47:55 +00:00
|
|
|
workflow_dispatch:
|
2024-07-20 19:38:21 +00:00
|
|
|
|
|
|
|
env:
|
|
|
|
REGISTRY_ENDPOINT: host.containers.internal:5000
|
|
|
|
|
|
|
|
jobs:
|
2024-07-21 17:25:34 +00:00
|
|
|
pre-run:
|
2024-11-07 00:31:22 +00:00
|
|
|
runs-on: imagefactory-latest
|
2024-07-21 17:25:34 +00:00
|
|
|
steps:
|
|
|
|
- uses: https://forge.karnov.club/marc/push-status-to-discord-action@main
|
|
|
|
with:
|
|
|
|
webhook-url: ${{secrets.DISCORD_WEBHOOK_URL}}
|
|
|
|
status: "Started"
|
|
|
|
init: true
|
2024-11-07 02:16:02 +00:00
|
|
|
build-runner:
|
2024-07-29 03:17:03 +00:00
|
|
|
needs: [pre-run]
|
2024-11-07 00:31:22 +00:00
|
|
|
runs-on: imagefactory-latest
|
2024-07-20 19:38:21 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
2024-07-29 03:17:03 +00:00
|
|
|
- uses: actions/setup-python@v5
|
|
|
|
with:
|
|
|
|
python-version: 3.12
|
2024-07-20 19:38:21 +00:00
|
|
|
- name: Login to Registry
|
|
|
|
run: podman login -u ${{ secrets.REGISTRY_USER }} -p ${{ secrets.REGISTRY_TOKEN }} ${{ env.REGISTRY_ENDPOINT }}
|
|
|
|
- name: Set image metadata
|
|
|
|
id: image-metadata
|
|
|
|
run: |
|
2024-07-29 03:17:03 +00:00
|
|
|
echo "image-tag=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
2024-11-07 02:16:02 +00:00
|
|
|
echo "full-image-name=debian-12.6-slim:$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
2024-07-20 19:38:21 +00:00
|
|
|
- name: Build image
|
2024-11-07 02:16:02 +00:00
|
|
|
run: python ./build_image.py ${{ steps.image-metadata.outputs.full-image-name }} ./images/debian-12.6-slim/Dockerfile
|
2024-07-20 19:38:21 +00:00
|
|
|
- name: Tag image as latest
|
2024-11-07 02:16:02 +00:00
|
|
|
run: podman tag ${{ steps.image-metadata.outputs.full-image-name }} debian-12.6-slim:latest
|
2024-07-20 19:38:21 +00:00
|
|
|
- name: List images
|
|
|
|
run: podman image ls
|
|
|
|
- name: Push tagged image to registry
|
2024-11-07 02:16:02 +00:00
|
|
|
if: ${{ github.event_name == 'push' }}
|
2024-07-20 19:38:21 +00:00
|
|
|
run: |
|
|
|
|
podman push ${{ steps.image-metadata.outputs.full-image-name }} ${{ env.REGISTRY_ENDPOINT }}/forge-runners/${{ steps.image-metadata.outputs.full-image-name }}
|
2024-11-07 02:16:02 +00:00
|
|
|
podman push ${{ steps.image-metadata.outputs.full-image-name }} ${{ env.REGISTRY_ENDPOINT }}/forge-runners/debian-12.6-slim:latest
|
2024-07-21 17:25:34 +00:00
|
|
|
post-run:
|
2024-11-07 00:31:22 +00:00
|
|
|
runs-on: imagefactory-latest
|
2024-11-07 02:16:02 +00:00
|
|
|
needs: [build-runner]
|
2024-07-21 17:25:34 +00:00
|
|
|
steps:
|
|
|
|
- uses: https://forge.karnov.club/marc/push-status-to-discord-action@main
|
|
|
|
if: ${{success()}}
|
|
|
|
with:
|
|
|
|
webhook-url: ${{secrets.DISCORD_WEBHOOK_URL}}
|
|
|
|
status: "Success"
|
|
|
|
variant: "success"
|
|
|
|
- uses: https://forge.karnov.club/marc/push-status-to-discord-action@main
|
|
|
|
if: ${{failure()}}
|
|
|
|
with:
|
|
|
|
webhook-url: ${{secrets.DISCORD_WEBHOOK_URL}}
|
|
|
|
status: "Failure"
|
|
|
|
variant: "failure"
|