Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: Yuri Shkuro <github@ysh.us>
  • Loading branch information
yurishkuro committed Jun 29, 2024
1 parent 53b265c commit 92eb118
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,18 @@ jobs:
with:
install: true

- name: Start local Docker registry
if: ${{ github.event_name == 'pull_request' }}
run: docker inspect registry > /dev/null || docker run --rm -d -p 5000:5000 --name registry registry:2

- name: Extract tags/labels from Git
id: docker_meta
uses: docker/metadata-action@v5
with:
images: jaegertracing/protobuf
# when running on pull request we want to push the image to local registry for further testing
images: |
jaegertracing/protobuf,enabled=${{ github.event_name != 'pull_request' }}
localhost:5000/jaegertracing/protobuf,enabled=${{ github.event_name == 'pull_request' }}
# The 'tags:' section defines how the Docker image will be tagged:
# - pushes to main branch will be published as 'latest'
# - pushes tagged with semver will be published as that version (without 'v')
Expand All @@ -39,7 +46,7 @@ jobs:
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=semver,pattern={{version}}
type=ref,event=tag
type=sha
type=sha,enable=${{ github.event_name == 'pull_request' }}
- name: Login to DockerHub
if: github.event_name != 'pull_request'
Expand All @@ -51,7 +58,7 @@ jobs:
- name: Build and maybe push Docker image
uses: docker/build-push-action@v6
with:
push: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }}
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
context: .
Expand Down

0 comments on commit 92eb118

Please sign in to comment.