Skip to content

Commit fb7fa1e

Browse files
topi314freyacodes
andauthored
fix github actions issues (#698)
* remove on pull_request & block job from running if no dokcer secrets are provided * remove on pull_request for workflow * remove unneeded check & expression syntax in if * run docker job only if secrets are set * fix job name * fix needs job name * fix docker job output * Test docker push * Force docker push test * fix misnamed job output * hopefully fix the issue to run the docker job * fix missing " * Delete test Co-authored-by: Freya Arbjerg <[email protected]>
1 parent 1918279 commit fb7fa1e

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ on:
44
push:
55
paths-ignore:
66
- '**.md'
7-
pull_request:
87

98
jobs:
109
gradle:
1110
runs-on: ubuntu-latest
12-
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
11+
outputs:
12+
rundocker: ${{ steps.rundocker.outputs.rundocker }}
1313
steps:
1414
- name: Checkout
1515
uses: actions/checkout@v3
@@ -33,10 +33,19 @@ jobs:
3333
name: Lavalink.jar
3434
path: LavalinkServer/build/libs/Lavalink.jar
3535

36+
- name: Check Docker Build
37+
id: rundocker
38+
env:
39+
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
40+
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
41+
run: |
42+
echo "Run docker build: ${{ env.DOCKERHUB_USERNAME != '' && env.DOCKERHUB_TOKEN != '' }}"
43+
echo "::set-output name=rundocker::${{ env.DOCKERHUB_USERNAME != '' && env.DOCKERHUB_TOKEN != '' }}"
44+
3645
docker:
3746
needs: gradle
3847
runs-on: ubuntu-latest
39-
if: github.event_name != 'pull_request'
48+
if: needs.gradle.outputs.rundocker == 'true'
4049
steps:
4150
- name: Checkout
4251
uses: actions/checkout@v2
@@ -83,7 +92,7 @@ jobs:
8392
release:
8493
needs: gradle
8594
runs-on: ubuntu-latest
86-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
95+
if: startsWith(github.ref, 'refs/tags/')
8796
steps:
8897
- name: Checkout
8998
uses: actions/checkout@v2

0 commit comments

Comments
 (0)