-
Notifications
You must be signed in to change notification settings - Fork 59
65 lines (60 loc) · 1.83 KB
/
docker.yml
File metadata and controls
65 lines (60 loc) · 1.83 KB
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
57
58
59
60
61
62
63
64
65
name: docker
on:
workflow_dispatch:
push:
tags:
- relayer-v[0-9]+.[0-9]+.[0-9]+
pull_request:
paths:
- '**.rs'
- '**.toml'
- '**.lock'
- '**.proto'
- 'abi/**'
# Cancel the workflow if a new commit is pushed to the branch/PR
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-relayer:
runs-on: depot-ubuntu-24.04-4
permissions:
id-token: write
contents: read
packages: write
env:
registry_url: ghcr.io/cosmos/eureka-relayer
steps:
- uses: actions/checkout@v5
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
env:
DOCKER_METADATA_PR_HEAD_SHA: true
with:
# list of Docker images to use as base name for tags
images: |
${{ env.registry_url }}
tags: |
# Tag triggered events
type=match,event=tag,pattern=^relayer-(v[0-9]+\.[0-9]+\.[0-9]+)$,group=1,priority=1000
# Latest, but only on main
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' && github.event_name != 'workflow_dispatch' }},priority=900
# For PR tags
type=ref,event=pr,priority=800
# For sha tags
type=sha,priority=700,prefix=
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: ./programs/relayer/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: true