Skip to content

ci: fix builder

ci: fix builder #158

Workflow file for this run

name: "Publish builder image"
on:
workflow_dispatch:
push:
paths:
- 'builder/**'
permissions:
packages: write
jobs:
publish_images:
name: 'Build podman builder image'
runs-on: ubuntu-latest
env:
IMAGETAG: ${{ github.ref_name }}
steps:
- uses: actions/checkout@v4
- name: Fetch tag annotations
run: |
# Fetch tag manually because fetch-tags option for checkout@v4 does not work
git fetch --force --tags --depth 1
- id: build
name: Build podman image
run: |
# Build the module images
cd builder/
bash build-builder
- id: publish
name: Publish podman image to GH registry
run: |
# Publish the branch
trap 'buildah logout ghcr.io' EXIT
buildah login -u ${{ github.actor }} --password-stdin ghcr.io <<<"${{ secrets.GITHUB_TOKEN }}"
image='ghcr.io/nethserver/nethsecurity-builder'
if [[ "${IMAGETAG}" == "main" ]]; then
IMAGETAG=latest
fi
buildah push $image docker://${image}:${IMAGETAG:-latest}
urls="${image}:${IMAGETAG:-latest}"$'\n'"${urls}"
echo "::notice title=Image URLs::${urls}"