-
Notifications
You must be signed in to change notification settings - Fork 7
69 lines (59 loc) · 1.77 KB
/
docker_image.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
---
name: Build docker image
permissions:
contents: read
on:
push:
branches:
- 'master'
- 'testnet'
tags:
- '*'
jobs:
build_docker:
runs-on: [self-hosted, linux]
steps:
- uses: actions/checkout@v4
- name: Prepare
id: prep
run: |
TAG=$(echo $GITHUB_SHA | head -c7)
TS=$(date +%s)
echo ::set-output name=branch_name::$(echo ${GITHUB_REF##*/})
echo ::set-output name=tag::${TAG}
echo ::set-output name=ts::${TS}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Setup docker context for buildx
id: buildx-context
run: |
docker context create builders
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
endpoint: builders
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Login to Dockerhub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: docker.io/interlayhq/interbtc-hydra-processor
tags: |
type=sha,prefix=${{ steps.prep.outputs.branch_name }}-,suffix=-${{ steps.prep.outputs.ts }}
type=ref,event=branch
type=ref,event=tag
- name: Build and push
id: docker_build
uses: docker/build-push-action@v6
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64 #,linux/arm64