Skip to content

Update docker publishing to match documentation #41

Update docker publishing to match documentation

Update docker publishing to match documentation #41

Workflow file for this run

name: Weaver Docker Generator
on:
push:
tags: [ '**' ]
branches:
- main
pull_request:
branches:
- main
paths:
- .github/workflows/publish-docker.yml
- 'src/**'
- 'crates/**'
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build the Docker image
run: docker build . -t weaver && docker run --rm weaver --help
build-and-publish-docker:
runs-on: ubuntu-latest
needs: tests
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: otel/weaver
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}