Skip to content

Commit

Permalink
fix: Only build and release docker when release is created
Browse files Browse the repository at this point in the history
  • Loading branch information
andymac4182 committed Apr 26, 2023
1 parent 1468cb1 commit fe26002
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/release-please.yml
Expand Up @@ -10,7 +10,7 @@ name: release-please

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
IMAGE_NAME: "markdown-confluence/markdown-confluence"

jobs:
release-please:
Expand Down Expand Up @@ -62,19 +62,22 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}

- name: Log in to the Container registry
if: ${{ steps.release-please.outputs.release_created }}
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
password: ${{ secrets.RELEASE_PLEASE_PAT }}

- name: Extract metadata (tags, labels) for Docker
if: ${{ steps.release-please.outputs.release_created }}
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
if: ${{ steps.release-please.outputs.release_created }}
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: packages/cli
Expand Down

0 comments on commit fe26002

Please sign in to comment.