Build sonic base image #1
This file contains hidden or 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: 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: | | |
| [ "${GITHUB_EVENT_NAME}" == 'workflow_dispatch' ] && echo "tag=${GITHUB_HEAD_REF##*/}" >> $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 }} |