-
Notifications
You must be signed in to change notification settings - Fork 2
53 lines (44 loc) · 1.48 KB
/
publish-version.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
name: Publish to Docker Registry
on:
release:
types: [published]
env:
BASE_IMAGE_NAME: rmind/nxsearch-svc
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: build
shell: bash
env:
DOCKER_BUILDKIT: 1
run: |
#
# NOTE: remove spaces and smaller than 128 characters.
# see more: https://docs.docker.com/engine/reference/commandline/tag/
RELEASE_TAG=${BASE_IMAGE_NAME}:${{github.event.release.tag_name}}
RELEASE_TAG=${RELEASE_TAG//[[:blank:]]/}
RELEASE_TAG="${RELEASE_TAG:0:127}"
docker pull ${BASE_IMAGE_NAME}:ci || echo "Can't download"
echo "Pushing release ${RELEASE_TAG}"
docker buildx build \
--tag ${RELEASE_TAG} \
--cache-from ${BASE_IMAGE_NAME}:ci \
--build-arg BUILDKIT_INLINE_CACHE=1 \
--target nxsearch-svc \
--output type=docker \
-f compose/svc.Dockerfile .
- name: push
shell: bash
run: docker push ${RELEASE_IMAGE_NAME}