11name : Build and Push Docker Image
22
3- # This workflow builds and pushes Docker images to Docker Hub and GitHub Container Registry:
3+ # This workflow builds and pushes Docker images to GitHub Container Registry:
44# - Pull requests: Tagged as pr-NUMBER (e.g., pr-59)
55# - Main branch: Tagged as canary
66# - Version tags: Tagged as the version and latest
77#
88# Images are pushed to:
9- # - Docker Hub: betterstack/collector, betterstack/collector-beyla
109# - GHCR: ghcr.io/<owner>/collector, ghcr.io/<owner>/collector-ebpf
1110
1211on :
@@ -62,19 +61,16 @@ jobs:
6261 git diff --exit-code
6362 fi
6463
65- - name : Determine repository and tags
64+ - name : Determine push flag
6665 id : repo
6766 run : |
68- # Always use public repo
69- echo "repository=betterstack/collector" >> $GITHUB_OUTPUT
7067 echo "push=true" >> $GITHUB_OUTPUT
7168
7269 - name : Set up Docker metadata
7370 id : meta
7471 uses : docker/metadata-action@v5
7572 with :
7673 images : |
77- ${{ steps.repo.outputs.repository }}
7874 ghcr.io/${{ github.repository_owner }}/collector
7975 tags : |
8076 # For version tags, tag as version and latest
8581 # For pull requests, tag as pr-NUMBER
8682 type=raw,value=pr-${{ github.event.pull_request.number }},enable=${{ github.event_name == 'pull_request' }}
8783
88- - name : Log in to Docker Hub
89- uses : docker/login-action@v3
90- with :
91- username : ${{ secrets.DOCKERHUB_USERNAME }}
92- password : ${{ secrets.DOCKERHUB_TOKEN }}
93-
9484 - name : Log in to GitHub Container Registry
9585 uses : docker/login-action@v3
9686 with :
@@ -112,8 +102,6 @@ jobs:
112102 push : ${{ steps.repo.outputs.push }}
113103 tags : ${{ steps.meta.outputs.tags }}
114104 labels : ${{ steps.meta.outputs.labels }}
115- build-args : |
116- COLLECTOR_VERSION=${{ github.ref_name }}
117105
118106 build-beyla :
119107 runs-on : ubuntu-latest
@@ -127,19 +115,16 @@ jobs:
127115 with :
128116 submodules : true
129117
130- - name : Determine repository and tags
118+ - name : Determine push flag
131119 id : repo
132120 run : |
133- # Always use public repo
134- echo "repository=betterstack/collector-beyla" >> $GITHUB_OUTPUT
135121 echo "push=true" >> $GITHUB_OUTPUT
136122
137123 - name : Set up Docker metadata
138124 id : meta
139125 uses : docker/metadata-action@v5
140126 with :
141127 images : |
142- ${{ steps.repo.outputs.repository }}
143128 ghcr.io/${{ github.repository_owner }}/collector-ebpf
144129 tags : |
145130 # For version tags, tag as version and latest
@@ -150,12 +135,6 @@ jobs:
150135 # For pull requests, tag as pr-NUMBER
151136 type=raw,value=pr-${{ github.event.pull_request.number }},enable=${{ github.event_name == 'pull_request' }}
152137
153- - name : Log in to Docker Hub
154- uses : docker/login-action@v3
155- with :
156- username : ${{ secrets.DOCKERHUB_USERNAME }}
157- password : ${{ secrets.DOCKERHUB_TOKEN }}
158-
159138 - name : Log in to GitHub Container Registry
160139 uses : docker/login-action@v3
161140 with :
0 commit comments