build: support snapshosts (#846) #164
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
with: | |
fetch-depth: 500 | |
- 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}" |