Skip to content

Commit

Permalink
Add workflow to create image
Browse files Browse the repository at this point in the history
  • Loading branch information
dbason committed Mar 21, 2023
1 parent e094466 commit effbada
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/images.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish Image

on:
push:
tags:
- '*'

env:
REGISTRY: ghcr.io

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
echo TAG_NAME=$(echo $GITHUB_REF | sed -e "s|refs/tags/||") >> $GITHUB_ENV
- name: Build and push collector
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ env.REGISTRY }}/${{ github.repository_owner }}/opni-otel-collector:${{ env.TAG_NAME }}-0.71.0

0 comments on commit effbada

Please sign in to comment.