-
Notifications
You must be signed in to change notification settings - Fork 5
44 lines (41 loc) · 1.25 KB
/
publish-builder.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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}"