2024-11-06 04:41:36 +00:00
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- "v*"
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
pre-run:
|
|
|
|
runs-on: imagefactory-latest
|
|
|
|
steps:
|
|
|
|
- uses: https://forge.karnov.club/marc/push-status-to-discord-action@main
|
|
|
|
with:
|
|
|
|
webhook-url: ${{secrets.DISCORD_WEBHOOK_URL}}
|
|
|
|
status: "Started"
|
|
|
|
init: true
|
|
|
|
build:
|
|
|
|
needs: [pre-run]
|
|
|
|
runs-on: imagefactory-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Spud
|
|
|
|
uses: https://forge.karnov.club/spadinastan/setup-spud-action@feat/install-spud-in-env
|
|
|
|
- name: Login to Registry
|
2024-11-07 18:37:59 +00:00
|
|
|
run: podman login -u ${{ secrets.REGISTRY_USER }} -p ${{ secrets.REGISTRY_TOKEN }} ${{ vars.REGISTRY_ENDPOINT }}
|
2024-11-06 04:41:36 +00:00
|
|
|
- name: Set image metadata
|
|
|
|
id: image-metadata
|
|
|
|
run: |
|
|
|
|
echo "image-tag=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
|
|
|
- name: Build images
|
|
|
|
run: |
|
|
|
|
spud build -d ./service.yml
|
|
|
|
podman image ls
|
2024-11-07 18:41:28 +00:00
|
|
|
- name: Push tagged images to registry
|
2024-11-06 04:41:36 +00:00
|
|
|
if: ${{ github.event_name == 'push' }}
|
|
|
|
run: |
|
2024-11-07 18:48:56 +00:00
|
|
|
podman push localhost/sesame/caddy:latest ${{ vars.REGISTRY_ENDPOINT }}/sesame/caddy:latest
|
|
|
|
podman push localhost/sesame/caddy:latest ${{ vars.REGISTRY_ENDPOINT }}/sesame/caddy:${{ steps.image-metadata.outputs.image-tag }}
|
|
|
|
podman push localhost/sesame/caddy:latest ${{ vars.REGISTRY_ENDPOINT }}/sesame/caddy:${{ github.ref_name }}
|
|
|
|
podman push localhost/sesame/promtail:latest ${{ vars.REGISTRY_ENDPOINT }}/sesame/promtail:latest
|
|
|
|
podman push localhost/sesame/promtail:latest ${{ vars.REGISTRY_ENDPOINT }}/sesame/promtail:${{ steps.image-metadata.outputs.image-tag }}
|
|
|
|
podman push localhost/sesame/promtail:latest ${{ vars.REGISTRY_ENDPOINT }}/sesame/promtail:${{ github.ref_name }}
|
2024-11-06 04:41:36 +00:00
|
|
|
post-run:
|
|
|
|
runs-on: imagefactory-latest
|
|
|
|
needs: [build]
|
|
|
|
steps:
|
|
|
|
- uses: https://forge.karnov.club/marc/push-status-to-discord-action@main
|
|
|
|
if: ${{always() && 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: ${{always() && failure()}}
|
|
|
|
with:
|
|
|
|
webhook-url: ${{secrets.DISCORD_WEBHOOK_URL}}
|
|
|
|
status: "Failure"
|
|
|
|
variant: "failure"
|