Skip to content

Build sonic base image #2

Build sonic base image

Build sonic base image #2

Workflow file for this run

---
name: Build sonic base image
on: workflow_dispatch
env:
REGISTRY: ghcr.io
jobs:
build-mini-lab-sonic-base-image:
name: build mini-lab-sonic base image
runs-on: ubuntu-latest
steps:
- name: Log in to the container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKER_REGISTRY_USER }}
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
- name: Checkout
uses: actions/checkout@v4
- name: Make tag
run: |
git fetch --tags
echo "tag=$(git describe --tags --exact-match 2> /dev/null || git symbolic-ref -q --short HEAD || git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push mini-lab-sonic container
uses: docker/build-push-action@v6
with:
push: true
sbom: true
file: images/sonic/base/Dockerfile
tags: ${{ env.REGISTRY }}/metal-stack/mini-lab-sonic-base:${{ env.tag }}