-
Notifications
You must be signed in to change notification settings - Fork 2
37 lines (32 loc) · 1.21 KB
/
docker-publish.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
name: Docker
on:
push:
tags:
- v*
env:
IMAGE_NAME: aruna-web
jobs:
push:
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v2
- uses: arduino/setup-protoc@v2
- name: Clean up docker
run: docker system prune -af
- name: Build image
run: docker build . --file Dockerfile --tag $IMAGE_NAME
- name: Push image to harbor registry
run: |
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "main" ] && VERSION="${{ github.run_number }}"
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
echo "${{ secrets.HARBORPW }}" | docker login harbor.computational.bio.uni-giessen.de -u '${{ secrets.HARBORUSER }}' --password-stdin
HARBOR_IMAGE_ID=harbor.computational.bio.uni-giessen.de/aruna/arunaweb
docker tag $IMAGE_NAME $HARBOR_IMAGE_ID:$VERSION
docker push $HARBOR_IMAGE_ID:$VERSION