Skip to content

build VyOS Builder Image #24

build VyOS Builder Image

build VyOS Builder Image #24

name: build VyOS Builder Image
on:
schedule:
- cron: "0 1 1 * *"
workflow_dispatch:
inputs:
source_ref:
description: 'source ref'
default: 'rolling'
image_tag:
description: 'image tag'
default: 'rolling-arm64'
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}/vyos-builder
jobs:
build-and-push-image:
runs-on: ubuntu-24.04-arm
permissions:
contents: read
packages: write
id-token: write
attestations: write
steps:
- name: "Initialization: set env variables"
id: set_env_variables
run: |
set -ex
if [ -n "${{ github.event.inputs.source_ref }}" ]; then
echo "source_ref=${{ github.event.inputs.source_ref }}" >> $GITHUB_OUTPUT
else
echo "source_ref=rolling" >> $GITHUB_OUTPUT
fi
if [ -n "${{ github.event.inputs.image_tag }}" ]; then
echo "image_tag=${{ github.event.inputs.image_tag }}" >> $GITHUB_OUTPUT
else
echo "image_tag=rolling-arm64" >> $GITHUB_OUTPUT
fi
- name: Checkout repository
uses: actions/checkout@v7
with:
repository: vyos/vyos-build
ref: ${{ steps.set_env_variables.outputs.source_ref }}
- name: Log in to the Container registry
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v6
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: ${{ steps.set_env_variables.outputs.image_tag }}
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v7
with:
context: docker
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}