Repository navigation
60 lines (49 loc) · 1.52 KB
/
Copy pathrelease.yml
File metadata and controls
60 lines (49 loc) · 1.52 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
name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
env:
DOCKER_REGISTRY: ghcr.io
jobs:
build-packages:
name: Build packages
runs-on: ubuntu-latest
strategy:
matrix:
image:
- indexer
- web
steps:
- uses: actions/checkout@v5
- name: Docker login
uses: docker/login-action@v1
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ${{ env.DOCKER_REGISTRY }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- uses: benjlevesque/short-sha@v1.2
- uses: olegtarasov/get-tag@v2.1
- name: Publish docker image hash
id: publish-image-hash
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
file: docker/${{ matrix.image }}.Dockerfile
tags: ${{ env.DOCKER_REGISTRY }}/${{ github.repository }}/${{ matrix.image }}:sha-${{ env.SHA }}
- name: Publish docker image tag
if: startsWith(github.ref, 'refs/tags/v')
env:
IMAGE_TAG_HASH: ${{ env.DOCKER_REGISTRY }}/${{ github.repository }}/${{ matrix.image }}
IMAGE_DIGEST: ${{ steps.publish-image-hash.outputs.digest }}
run: |
docker buildx imagetools create \
--tag ${IMAGE_TAG_HASH}:${GIT_TAG_NAME} \
${IMAGE_TAG_HASH}@${IMAGE_DIGEST}