forked from qdrant/qdrant
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (33 loc) · 1.28 KB
/
Copy pathdocker-image.yml
File metadata and controls
45 lines (33 loc) · 1.28 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
name: Build and deploy docker image
on:
workflow_dispatch:
push:
# Pattern matched against refs/tags
tags:
- '*' # Push events to every tag not containing /
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- name: Get current tag
id: vars
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: Build the Docker image
env:
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker buildx create --use
docker login --username generall --password ${{ secrets.DOCKERHUB_TOKEN }}
DOCKERHUB_TAG="qdrant/qdrant:${{ github.ref_name }}"
TAGS="-t ${DOCKERHUB_TAG}"
DOCKERHUB_TAG_LATEST="qdrant/qdrant:latest"
TAGS="${TAGS} -t ${DOCKERHUB_TAG_LATEST}"
GITHUB_TAG="docker.pkg.github.com/qdrant/qdrant/qdrant:${{ github.ref_name }}"
docker buildx build --platform='linux/amd64,linux/arm64' $TAGS --push .
docker pull $DOCKERHUB_TAG
docker login https://docker.pkg.github.com -u qdrant --password ${{ secrets.GITHUB_TOKEN }}
docker tag $DOCKERHUB_TAG $GITHUB_TAG
docker push $GITHUB_TAG