-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (46 loc) · 1.55 KB
/
publish-image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: CI/CD pipeline
env:
DOCKER_REGISTRY: nethermind.jfrog.io
REPO_DEV: angkor-oci-local-dev
REPO_STAGING: angkor-oci-local-staging
REPO_PROD: angkor-oci-local-prod
IMAGE_NAME: eigenlayer-onchain-exporter
on:
push:
branches: [main]
workflow_dispatch:
permissions:
id-token: write
contents: write
jobs:
build_docker_image:
runs-on: ubuntu-latest
outputs:
DOCKER_IMAGE_NAME: ${{ env.IMAGE_NAME }}
DOCKER_IMAGE_TAG: ${{ steps.set_tag.outputs.DOCKER_IMAGE_TAG }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Define image tag
id: set_tag
run: |
export DOCKER_IMAGE_TAG=$(git describe --tags)
# This one is to be able to use the image tag in the next steps in this job
echo "DOCKER_IMAGE_TAG=$DOCKER_IMAGE_TAG" >> $GITHUB_ENV
# This one is to be able to use the image tag in the next jobs
echo "DOCKER_IMAGE_TAG=$DOCKER_IMAGE_TAG" >> $GITHUB_OUTPUT
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to registry
run: |
docker login ${{ env.DOCKER_REGISTRY }} -u ${{ secrets.ARTIFACTORY_ANGKOR_USERNAME }} -p ${{ secrets.ARTIFACTORY_ANGKOR_TOKEN_CONTRIBUTOR }}
- name: Build and Push
uses: docker/build-push-action@v6
with:
context: .
platforms: "linux/amd64"
push: true
tags: |
${{ env.DOCKER_REGISTRY }}/${{ env.REPO_DEV }}/${{ env.IMAGE_NAME }}:latest