Skip to content

Commit

Permalink
Make it reusable
Browse files Browse the repository at this point in the history
Signed-off-by: Israel Blancas <[email protected]>
  • Loading branch information
iblancasa committed Sep 25, 2023
1 parent 6cb99f5 commit 6abf841
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 39 deletions.
44 changes: 5 additions & 39 deletions .github/workflows/publish-autoinstrumentation-e2e-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,42 +18,8 @@ concurrency:
cancel-in-progress: true

jobs:
dotnet:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/open-telemetry/opentelemetry-operator/dotnet-test
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to GitHub Package Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v4
with:
context: tests/instrumentation-e2e-apps/dotnet
platforms: linux/arm64,linux/amd64
push: ${{ github.event_name == 'push' }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
golang:
uses: ./.github/workflows/reusable-publish-autoinstrumentation-e2e-images.yaml
with:
language: golang
platforms: linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: "Publish instrumentation E2E tests images"

on:
workflow_call:
inputs:
language:
type: string
required: true
platforms:
type: string
required: true

jobs:
publish-e2e-test-image:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to GitHub Package Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
with:
tags: ghcr.io/open-telemetry/opentelemetry-operator/e2e-test-app-${{ inputs.language }}
context: tests/instrumentation-e2e-apps/${{ inputs.language }}
platforms: ${{ inputs.platforms }}
push: ${{ github.event_name == 'push' }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache

0 comments on commit 6abf841

Please sign in to comment.