1111 - main
1212
1313jobs :
14- build :
14+ build-collector :
1515 runs-on : ubuntu-latest
1616 permissions :
1717 contents : read
8080 labels : ${{ steps.meta.outputs.labels }}
8181 build-args : |
8282 COLLECTOR_VERSION=${{ github.ref_name }}
83+
84+ build-beyla :
85+ runs-on : ubuntu-latest
86+ permissions :
87+ contents : read
88+ packages : write
89+
90+ steps :
91+ - name : Checkout code
92+ uses : actions/checkout@v4
93+ with :
94+ submodules : true
8395
96+ - name : Determine repository and tags
97+ id : repo
98+ run : |
99+ if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
100+ # Tagged versions go to public repo
101+ echo "repository=betterstack/collector-beyla" >> $GITHUB_OUTPUT
102+ echo "push=true" >> $GITHUB_OUTPUT
103+ else
104+ # Everything else goes to private repo
105+ echo "repository=betterstack/collector-beyla-private" >> $GITHUB_OUTPUT
106+ echo "push=true" >> $GITHUB_OUTPUT
107+ fi
108+
109+ - name : Set up Docker metadata
110+ id : meta
111+ uses : docker/metadata-action@v5
112+ with :
113+ images : ${{ steps.repo.outputs.repository }}
114+ tags : |
115+ # For version tags, tag as version and latest (public repo)
116+ type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
117+ type=semver,pattern={{version}},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
118+ # For main branch, tag as main-sha (private repo)
119+ type=raw,value=main-sha-{{sha}},enable=${{ github.ref == 'refs/heads/main' }}
120+ # For pull requests, tag as pr-number-sha (private repo)
121+ type=raw,value=pr-${{ github.event.pull_request.number }}-sha-{{sha}},enable=${{ github.event_name == 'pull_request' }}
122+
123+ - name : Log in to Docker Hub
124+ uses : docker/login-action@v3
125+ with :
126+ username : ${{ secrets.DOCKERHUB_USERNAME }}
127+ password : ${{ secrets.DOCKERHUB_TOKEN }}
128+
129+ - name : Set up Depot
130+ uses : depot/setup-action@v1
131+
132+ - name : Build and push Docker image
133+ uses : depot/build-push-action@v1
134+ with :
135+ project : ${{ secrets.DEPOT_PROJECT_ID }}
136+ token : ${{ secrets.DEPOT_API_TOKEN }}
137+ context : .
138+ file : Dockerfile.beyla
139+ platforms : linux/amd64,linux/arm64
140+ push : ${{ steps.repo.outputs.push }}
141+ tags : ${{ steps.meta.outputs.tags }}
142+ labels : ${{ steps.meta.outputs.labels }}
0 commit comments