diff --git a/.github/workflows/build-and-publish-image.yml b/.github/workflows/build-and-publish-image.yml new file mode 100644 index 00000000000..ee982ba15a2 --- /dev/null +++ b/.github/workflows/build-and-publish-image.yml @@ -0,0 +1,41 @@ +name: Build and publish image + +on: + workflow_call: + inputs: + tags: + required: true + type: string + platforms: + required: true + type: string + build-args: + required: true + type: string + context: + required: true + type: string + secrets: + token: + required: true + +jobs: + build_push: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + - name: Login to Docker + run: docker login -u publisher -p ${{ secrets.token }} ghcr.io + - name: Docker Build + uses: docker/build-push-action@v3 + with: + push: true + tags: ${{ inputs.tags }} + platforms: ${{ inputs.platforms }} + build-args: ${{ inputs.build-args }} + context: ${{ inputs.context }} diff --git a/.github/workflows/lib-injection.yml b/.github/workflows/lib-injection.yml new file mode 100644 index 00000000000..32a272bae5a --- /dev/null +++ b/.github/workflows/lib-injection.yml @@ -0,0 +1,15 @@ +name: "Library Injection" +on: + # Build each branch for testing + push: + +jobs: + build-and-publish-test-image: + uses: ./.github/workflows/build-and-publish-image.yml + with: + tags: 'ghcr.io/datadog/dd-trace-rb/dd-lib-ruby-init:${{ github.sha }}' + platforms: 'linux/amd64,linux/arm64/v8' + build-args: 'DDTRACE_RUBY_VERSION=git+https://github.com/Datadog/dd-trace-rb@${{ github.sha }}' + context: ./lib-injection + secrets: + token: ${{ secrets.GITHUB_TOKEN }}