1+ # TODO: trigger only if testing or any other checks previously succeeded
2+ name : Push k8s cache to DockerHub (main)
3+ on :
4+ push :
5+ branches :
6+ - main
7+
8+ permissions :
9+ contents : read
10+ id-token : write
11+ packages : write
12+
13+ jobs :
14+ build-and-push-image :
15+ runs-on : ubuntu-latest
16+ env :
17+ IMAGE_NAME : opentelemetry-ebpf-k8s-cache
18+ steps :
19+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
20+ with :
21+ persist-credentials : false
22+
23+ - name : Log in to Docker Hub
24+ uses : docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
25+ with :
26+ username : ${{ vars.DOCKER_USERNAME }}
27+ password : ${{ secrets.DOCKER_TOKEN_EBPF_INSTRUMENTATION }}
28+
29+ - name : Log in to the Container registry
30+ uses : docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
31+ with :
32+ registry : ghcr.io
33+ username : ${{ github.repository_owner }}
34+ password : ${{ secrets.GITHUB_TOKEN }}
35+
36+ - name : Set up QEMU
37+ uses : docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
38+
39+ - name : Set up Docker Buildx
40+ uses : docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
41+
42+ - name : Extract metadata (tags, labels) for Docker
43+ id : meta
44+ uses : docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
45+ with :
46+ images : |
47+ otel/${{ env.IMAGE_NAME }}
48+ ghcr.io/${{ github.repository }}/${{ env.IMAGE_NAME }}
49+
50+ - name : Build and push
51+ uses : docker/build-push-action@1dc73863535b631f98b2378be8619f83b136f4a0 # v6.17.0
52+ with :
53+ context : .
54+ file : ./k8scache.Dockerfile
55+ push : true
56+ tags : ${{ steps.meta.outputs.tags }}
57+ labels : ${{ steps.meta.outputs.labels }}
58+ platforms : linux/amd64,linux/arm64
0 commit comments