Skip to content

Commit

Permalink
adding github action to build and push container
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgreen-moj committed Dec 6, 2023
1 parent a50c891 commit 9536a3f
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
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 }}

0 comments on commit 9536a3f

Please sign in to comment.