Skip to content

Commit dd0aee0

Browse files
committed
Fix failing GH Action
1 parent cfbd037 commit dd0aee0

File tree

5 files changed

+38
-9
lines changed

5 files changed

+38
-9
lines changed

.github/workflows/push.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,16 @@ jobs:
2020
runs-on: ubuntu-latest
2121
name: Builds new Netbox Docker Images
2222
steps:
23-
- name: Checkout
23+
- id: git-checkout
24+
name: Checkout
2425
uses: actions/checkout@v1
25-
- name: Build the image from '${{ matrix.docker_from }}' with '${{ matrix.build_cmd }}'
26+
- id: docker-build
27+
name: Build the image from '${{ matrix.docker_from }}' with '${{ matrix.build_cmd }}'
2628
run: ${{ matrix.build_cmd }}
2729
env:
2830
DOCKER_FROM: ${{ matrix.docker_from }}
2931
GH_ACTION: enable
30-
- name: Test the image
32+
- id: docker-test
33+
name: Test the image
3134
run: IMAGE="${FINAL_DOCKER_TAG}" ./test.sh
35+
if: steps.docker-build.outputs.skipped != 'true'

.github/workflows/release.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,33 @@ jobs:
1717
runs-on: ubuntu-latest
1818
name: Builds new Netbox Docker Images
1919
steps:
20-
- name: Checkout
20+
- id: git-checkout
21+
name: Checkout
2122
uses: actions/checkout@v1
22-
- name: Build the image with '${{ matrix.build_cmd }}'
23+
- id: docker-build
24+
name: Build the image with '${{ matrix.build_cmd }}'
2325
run: ${{ matrix.build_cmd }}
2426
env:
2527
GH_ACTION: enable
26-
- name: Test the image
28+
- id: docker-test
29+
name: Test the image
2730
run: IMAGE="${FINAL_DOCKER_TAG}" ./test.sh
28-
- name: Login to the Docker Registry
31+
if: steps.docker-build.outputs.skipped != 'true'
32+
- id: registry-login
33+
name: Login to the Docker Registry
2934
run: |
3035
echo "::add-mask::$DOCKERHUB_USERNAME"
3136
echo "::add-mask::$DOCKERHUB_PASSWORD"
3237
docker login -u "$DOCKERHUB_USERNAME" --password "${DOCKERHUB_PASSWORD}" "${DOCKER_REGISTRY}"
3338
env:
3439
DOCKERHUB_USERNAME: ${{ secrets.dockerhub_username }}
3540
DOCKERHUB_PASSWORD: ${{ secrets.dockerhub_password }}
36-
- name: Push the image
41+
if: steps.docker-build.outputs.skipped != 'true'
42+
- id: registry-push
43+
name: Push the image
3744
run: ${{ matrix.build_cmd }} --push-only
38-
- name: Logout of the Docker Registry
45+
if: steps.docker-build.outputs.skipped != 'true'
46+
- id: registry-logout
47+
name: Logout of the Docker Registry
3948
run: docker logout "${DOCKER_REGISTRY}"
49+
if: steps.docker-build.outputs.skipped != 'true'

build-latest.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ if [ "${PRERELEASE}" == "true" ]; then
6666

6767
echo "❎ Latest unstable version '${VERSION}' is not higher than the latest stable version '$STABLE_VERSION'."
6868
if [ -z "$DEBUG" ]; then
69+
if [ -n "${GH_ACTION}" ]; then
70+
echo "::set-output name=skipped::true"
71+
fi
72+
6973
exit 0
7074
else
7175
echo "⚠️ Would exit here with code '0', but DEBUG is enabled."

build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ for DOCKER_TARGET in "${DOCKER_TARGETS[@]}"; do
210210
fi
211211
if [ -n "${GH_ACTION}" ]; then
212212
echo "::set-env name=FINAL_DOCKER_TAG::${TARGET_DOCKER_TAG}"
213+
echo "::set-output name=skipped::false"
213214
fi
214215

215216
###

test.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ set -e
77
# of the Docker Image that is to be used
88
export IMAGE="${IMAGE-netboxcommunity/netbox:latest}"
99

10+
if [ -z "${IMAGE}" ]; then
11+
echo "⚠️ No image defined"
12+
13+
if [ -z "${DEBUG}" ]; then
14+
exit 1;
15+
else
16+
echo "⚠️ Would 'exit 1' here, but DEBUG is '${DEBUG}'."
17+
fi
18+
fi
19+
1020
# The docker compose command to use
1121
doco="docker-compose -f docker-compose.test.yml"
1222

0 commit comments

Comments
 (0)