Skip to content

Commit 3094a08

Browse files
committed
internal: add build+push CI job
Signed-off-by: Mattia Meleleo <mattia.meleleo@coralogix.com>
1 parent e589f84 commit 3094a08

22 files changed

+69
-1118
lines changed

.github/actions/integration-test-image-build/action.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/workflows/check_gh_actions_security.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/clang-format-check.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

.github/workflows/clang-tidy-check.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: CX build and push
2+
3+
on:
4+
push:
5+
branches: [ 'main', 'internal/build-push-job' ]
6+
pull_request:
7+
branches: [ 'internal/build-push-job' ]
8+
9+
env:
10+
AWS_REGION: eu-west-1
11+
AWS_ACCOUNT_ID: 897729105761 # tacotaco-research
12+
AWS_ROLE_TO_ASSUME: arn:aws:iam::897729105761:role/AnemiaAgentRole
13+
14+
jobs:
15+
build-and-push:
16+
runs-on: ubuntu-latest
17+
if: github.repository == 'coralogix/opentelemetry-ebpf-instrumentation'
18+
permissions:
19+
id-token: write
20+
packages: write
21+
contents: read
22+
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v3
26+
27+
- name: Configure AWS credentials
28+
uses: aws-actions/configure-aws-credentials@v4
29+
with:
30+
role-to-assume: ${{ env.AWS_ROLE_TO_ASSUME }}
31+
aws-region: ${{ env.AWS_REGION }}
32+
33+
- name: Login to Amazon ECR
34+
id: login-ecr
35+
run: |
36+
aws ecr get-login-password --region ${{ env.AWS_REGION }} | docker login --username AWS --password-stdin ${{ env.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com
37+
38+
- name: Create ECR Repositories
39+
run: |
40+
aws ecr create-repository --repository-name "obi-internal" --region ${{ env.AWS_REGION }} || echo "Repository obi-internal already exists."
41+
42+
- name: Set up buildx
43+
uses: docker/setup-buildx-action@v3
44+
with:
45+
driver: docker-container
46+
47+
- name: Cache images
48+
uses: actions/cache@v3
49+
with:
50+
path: /tmp/.buildx-cache
51+
key: ${{ runner.os }}-buildx-${{ github.sha }}
52+
restore-keys: |
53+
${{ runner.os }}-buildx-
54+
55+
- name: Set Git Commit Hash
56+
run: echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
57+
58+
- name: Build and push
59+
uses: docker/build-push-action@v6
60+
with:
61+
platforms: linux/amd64,linux/arm64
62+
context: .
63+
file: ./Dockerfile
64+
push: true
65+
tags: |
66+
${{ env.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/obi-internal:${{ env.COMMIT_HASH }}
67+
${{ env.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/obi-internal:latest
68+
cache-from: type=local,src=/tmp/.buildx-cache
69+
cache-to: type=local,dest=/tmp/.buildx-cache,new=true

.github/workflows/fossa.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/generator-image.yml

Lines changed: 0 additions & 102 deletions
This file was deleted.

0 commit comments

Comments
 (0)