Build sonic-vs container image #14
This file contains 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-vs container image | |
"on": | |
workflow_dispatch: | |
schedule: | |
- cron: "0 3 * * *" | |
push: | |
paths: | |
- .github/workflows/build-sonic-vs-container-image.yml | |
- sonic-vs/** | |
branches: | |
- main | |
pull_request: | |
paths: | |
- .github/workflows/build-sonic-vs-container-image.yml | |
- sonic-vs/** | |
jobs: | |
build-sonic-vs-container-image: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
version: | |
- latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup docker | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ secrets.DOCKER_REGISTRY }} | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
if: github.ref == 'refs/heads/main' | |
- name: Build container image | |
run: scripts/build.sh | |
env: | |
DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }} | |
IMAGE: sonic-vs | |
REPOSITORY: osism/sonic-vs | |
VERSION: ${{ matrix.version }} | |
- name: Push container image | |
run: | | |
scripts/push.sh | |
env: | |
DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }} | |
IMAGE: sonic-vs | |
REPOSITORY: osism/sonic-vs | |
VERSION: ${{ matrix.version }} | |
if: | | |
github.repository == 'osism/container-images' && | |
github.ref == 'refs/heads/main' |