Skip to content

Commit 0226641

Browse files
authored
added sonic base image workflow (#251)
1 parent eebed4e commit 0226641

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/base-image.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: Build sonic base image
3+
on: workflow_dispatch
4+
5+
env:
6+
REGISTRY: ghcr.io
7+
8+
jobs:
9+
build-mini-lab-sonic-base-image:
10+
name: build mini-lab-sonic base image
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Log in to the container registry
15+
uses: docker/login-action@v3
16+
with:
17+
registry: ${{ env.REGISTRY }}
18+
username: ${{ secrets.DOCKER_REGISTRY_USER }}
19+
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
20+
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Make tag
25+
run: |
26+
[ "${GITHUB_EVENT_NAME}" == 'workflow_dispatch' ] && echo "tag=${GITHUB_HEAD_REF##*/}" >> $GITHUB_ENV
27+
28+
- name: Set up Docker Buildx
29+
uses: docker/setup-buildx-action@v3
30+
31+
- name: Build and push mini-lab-sonic container
32+
uses: docker/build-push-action@v6
33+
with:
34+
push: true
35+
sbom: true
36+
file: images/sonic/base/Dockerfile
37+
tags: ${{ env.REGISTRY }}/metal-stack/mini-lab-sonic-base:${{ env.tag }}

0 commit comments

Comments
 (0)