Skip to content

Commit

Permalink
CI: wokflow changes
Browse files Browse the repository at this point in the history
- Image will bi build only on release;
  • Loading branch information
nickosh committed Aug 27, 2024
1 parent 931d4af commit 9b189ea
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
name: Build and Push Docker Image

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
release:
types: [published]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
Expand All @@ -33,6 +31,12 @@ jobs:
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}.{{patch}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=raw,value=latest
- name: Build and push Docker image
uses: docker/build-push-action@v6
Expand Down

0 comments on commit 9b189ea

Please sign in to comment.