-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (58 loc) · 2.2 KB
/
publish-docker.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
54
55
56
57
58
59
60
61
62
63
64
65
# Copyright (C) 2019-2023 Cyface GmbH - All Rights Reserved
# Unauthorized copying of this file, via any medium is strictly prohibited
# Proprietary and confidential.
#
# Pulls the required artifacts to build and publish the Docker images.
#
# author: Armin Schnabel
# since: 1.0.0
# version: 1.0.6
name: (Test) Publish docker images
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+*'
branches:
- main
pull_request:
branches:
- main
# Specify JARs version here.
env:
JARS_VERSION: '7.1.3'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# --------------------- Data-Collector ---------------------
- name: data-collector - Download JAR
run: |
wget --user ${{ secrets.GH_PACKAGES_READ_ACCOUNT }} --password ${{ secrets.GH_PACKAGES_READ_TOKEN }} \
https://maven.pkg.github.com/cyface-de/data-collector/de/cyface/collector/${{ env.JARS_VERSION }}/collector-${{ env.JARS_VERSION }}-all.jar \
-O collector-all.jar
mv collector-all.jar collector/collector-all.jar
- name: collector - (Test) Publish Docker Image
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: cyface-de/collector-docker/collector-docker
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: docker.pkg.github.com
tag_names: true
context: collector
# only push the Docker images if this is a release (to test workflow in PRs)
no_push: ${{ !(github.event_name == 'push' && contains(github.ref, 'refs/tags/')) }}
# --------------------- Mark Release-Tag on Github ---------------------
- name: Mark release on Github
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
uses: actions/create-release@v1
id: create_release
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
# Release tags of format `1.2.3-beta1 / -alpha1 / -test1` are considered a pre-release
prerelease: ${{ contains(github.ref, 'test') || contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}