-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (103 loc) · 3.13 KB
/
build-and-push.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
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Build docker images
on:
workflow_dispatch:
inputs:
tag:
description: 'The docker image tag'
required: true
push:
branches:
- master
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-[a-z]+"
pull_request:
branches:
- master
concurrency:
group: ${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
permissions:
packages: write
pages: write
id-token: write
contents: read
env:
GIT_LFS_SKIP_SMUDGE: 1
jobs:
docker-namada:
runs-on: [ubuntu-latest]
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/heliaxdev/namada-scenario-tester
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=raw,value=latest
- name: Build and Push
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
push: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v') }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
docker-ant:
runs-on: [ubuntu-latest]
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to private registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.ANTITHESIS_REGISTRY_URL }}
username: _json_key
password: ${{ secrets.ANTITHESIS_GAR_JSON_KEY }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ secrets.ANTITHESIS_REGISTRY_URL }}/namada-scenario-tester
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=raw,value=latest
- name: Build and Push
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile
push: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v') }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max