Skip to content

(chore): Attempt to move to official docker actions for building image #612

(chore): Attempt to move to official docker actions for building image

(chore): Attempt to move to official docker actions for building image #612

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/**'
env:
TEST_WEAVER_TAG: otel/weaver:test
jobs:
make-docker-image:
name: Docker Image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/[email protected]
with:
images: otel/weaver
- name: Build test image
uses: docker/[email protected]
with:
push: false
load: true
tags: ${{ env.TEST_WEAVER_TAG }}
labels: ${{ steps.meta.outputs.labels }}
- name: Test
run: |
docker run --rm ${{ env.TEST_WEAVER_TAG }} --help
- name: Log in to Docker Hub
uses: docker/[email protected]
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/[email protected]
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}