File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 push :
55 branches :
66 - master
7+ - dev
78
89jobs :
910 build-image :
2324 - name : Build and push image
2425 run : |
2526 SHORT_SHA=${GITHUB_SHA::7}
27+ BRANCH_NAME=${GITHUB_REF#refs/heads/}
28+
2629 docker build -t ghcr.io/voidcontests/runner:$SHORT_SHA \
27- -t ghcr.io/voidcontests/runner:latest .
28- docker push ghcr.io/voidcontests/runner:$SHORT_SHA
29- docker push ghcr.io/voidcontests/runner:latest
30+ -t ghcr.io/voidcontests/runner:$BRANCH_NAME .
31+
32+ if [[ "$BRANCH_NAME" == "master" || "$BRANCH_NAME" == "dev" ]]; then
33+ docker push ghcr.io/voidcontests/runner:$SHORT_SHA
34+ fi
35+
36+ docker push ghcr.io/voidcontests/runner:$BRANCH_NAME
37+
38+ if [[ "$BRANCH_NAME" == "master" ]]; then
39+ docker tag ghcr.io/voidcontests/runner:$SHORT_SHA ghcr.io/voidcontests/runner:latest
40+ docker push ghcr.io/voidcontests/runner:latest
41+ fi
You can’t perform that action at this time.
0 commit comments