Skip to content

adding github action to build and push container #2

adding github action to build and push container

adding github action to build and push container #2

Workflow file for this run

name: release
on:
push:
tags: ['v*.*.*'] # only a valid semver tag
env:
REGISTRY: ghcr.io
IMAGE_NAME: '${{ github.repository_owner }}/nvvs/juniper-mist-integration/app'
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker Login
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: metadata
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}