-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (81 loc) · 2.64 KB
/
docker.yaml
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Docker Package
on:
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
push:
branches:
- main
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push-image:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- dockerfile: ./osmosisd/Dockerfile
image: ghcr.io/defiantlabs/osmosisd
platforms: linux/amd64
tag: v20.1.0
- dockerfile: ./kujirad/Dockerfile
image: ghcr.io/defiantlabs/kujirad
platforms: linux/amd64
tag: v0.9.0
- dockerfile: ./odind/Dockerfile
image: ghcr.io/defiantlabs/odind
tag: v0.6.2
platforms: linux/amd64
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ matrix.image }}
labels: |
maintainer=danb
org.opencontainers.image.source=https://github.com/defiantlabs/externalPackages
org.opencontainers.image.title=externalPackages
org.opencontainers.image.description=Container Images for External Packages
org.opencontainers.image.vendor=Defiant
tags: |
type=raw,enable=true,priority=1,prefix=,suffix=,value=${{ matrix.tag }}
type=sha,enable=true,prefix=sha-,suffix=,format=short,priority=2
type=semver,pattern={{raw}},priority=3
type=edge,branch=main,priority=4
type=ref,event=branch,priority=5
type=ref,event=tag,priority=6
type=ref,event=pr,priority=7
- name: Build and push Docker images
uses: docker/build-push-action@v3
with:
context: .
platforms: ${{ matrix.platforms }}
file: ${{ matrix.dockerfile }}
build-args: VERSION=${{ matrix.tag }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max