File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 9
9
- name: Checkout master branch
10
10
uses: actions/checkout@v2
11
11
- name: Build Docker image
12
+ env:
13
+ OPENGROK_REPO_SLUG: ${{ github.repository }}
14
+ OPENGROK_PULL_REQUEST: ${{ github.head_ref }}
15
+ OPENGROK_REF : ${{ github.ref }}
12
16
run: ./dev/docker.sh
Original file line number Diff line number Diff line change @@ -15,8 +15,12 @@ set -e
15
15
API_URL=" https://hub.docker.com/v2"
16
16
IMAGE=" opengrok/docker"
17
17
18
- if [[ -n $TRAVIS_TAG ]]; then
19
- VERSION=" $TRAVIS_TAG "
18
+ if [[ -n $OPENGROK_REF && $OPENGROK_REF == refs/tags/* ]]; then
19
+ OPENGROK_TAG=${OPENGROK_REF# " refs/tags/" }
20
+ fi
21
+
22
+ if [[ -n $OPENGROK_TAG ]]; then
23
+ VERSION=" $OPENGROK_TAG "
20
24
VERSION_SHORT=$( echo $VERSION | cut -d. -f1,2 )
21
25
else
22
26
VERSION=" latest"
@@ -52,20 +56,20 @@ docker run -d $IMAGE
52
56
docker ps -a
53
57
54
58
# Travis can only work on master since it needs encrypted variables.
55
- if [ " ${TRAVIS_PULL_REQUEST } " != " false" ]; then
59
+ if [ " ${OPENGROK_PULL_REQUEST } " != " false" ]; then
56
60
echo " Not pushing Docker image for pull requests"
57
61
exit 0
58
62
fi
59
63
60
64
# The push only works on the main repository.
61
- if [[ " ${TRAVIS_REPO_SLUG } " != " oracle/opengrok" ]]; then
65
+ if [[ " ${OPENGROK_REPO_SLUG } " != " oracle/opengrok" ]]; then
62
66
echo " Not pushing Docker image for non main repository"
63
67
exit 0
64
68
fi
65
69
66
70
# Allow Docker push for release builds only.
67
- if [[ -z $TRAVIS_TAG ]]; then
68
- echo " TRAVIS_TAG is empty"
71
+ if [[ -z $OPENGROK_TAG ]]; then
72
+ echo " OPENGROK_TAG is empty"
69
73
exit 0
70
74
fi
71
75
You can’t perform that action at this time.
0 commit comments