name: Untrusted Artifacts on: workflow_call: permissions: contents: read jobs: container-image: name: Container image runs-on: ubuntu-latest permissions: contents: read steps: - name: Checkout repository uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - name: Set image name id: image-name run: echo "value=ghcr.io/${{ github.repository }}" >> "$GITHUB_OUTPUT" - name: Gather build metadata id: meta uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0 with: images: ${{ steps.image-name.outputs.value }} flavor: | latest = false tags: | type=ref,event=branch type=ref,event=pr,prefix=pr- type=semver,pattern={{raw}} type=raw,value=latest,enable={{is_default_branch}} type=ref,event=branch,suffix=-{{sha}}-{{date 'X'}},enable={{is_default_branch}} - name: Set up Docker Buildx uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0 - name: Build image uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0 with: context: . build-args: | VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }} platforms: linux/amd64 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} push: false benthos-collector-container-image: name: Benthos Collector Container image runs-on: ubuntu-latest permissions: contents: read steps: - name: Checkout repository uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - name: Set image name id: image-name run: echo "value=ghcr.io/openmeterio/benthos-collector" >> "$GITHUB_OUTPUT" - name: Gather build metadata id: meta uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0 with: images: ${{ steps.image-name.outputs.value }} flavor: | latest = false tags: | type=ref,event=branch type=ref,event=pr,prefix=pr- type=semver,pattern={{raw}} type=raw,value=latest,enable={{is_default_branch}} type=ref,event=branch,suffix=-{{sha}}-{{date 'X'}},enable={{is_default_branch}} - name: Set up Docker Buildx uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0 - name: Build image uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0 with: context: . file: benthos-collector.Dockerfile build-args: | VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }} platforms: linux/amd64 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} push: false