Skip to content

Commit

Permalink
Fix docker push to ghcr (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
joaopgrassi authored Apr 30, 2024
1 parent abf786e commit 2707384
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,38 @@ on:
tags:
- 'v*'

env:
REGISTRY: ghcr.io
IMAGE_NAME: otel-recipes/otlp-backend

jobs:
otlp-backend-docker:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: otel-recipes/otlp-backend

- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./internal/otlp_backend
push: ${{ github.event_name != 'pull_request' }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
site:
Expand Down

0 comments on commit 2707384

Please sign in to comment.