Skip to content

Commit

Permalink
Only push on tag
Browse files Browse the repository at this point in the history
  • Loading branch information
jovial committed Apr 27, 2023
1 parent 2df374c commit 75d1b88
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions .github/workflows/build-and-push-images.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
name: Create and publish a Docker image

on:
push:
branches:
- 'master'
tags:
tags:
- 'v*'
pull_request:
branches:
- 'master'
- 'main'

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
IMAGE_NAME: stackhpc/redfish-exporter

jobs:
build-and-push-image:
Expand All @@ -37,9 +34,7 @@ jobs:
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
# set latest tag for master branch
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
Expand Down

0 comments on commit 75d1b88

Please sign in to comment.