Skip to content

Commit f21b615

Browse files
committed
ci: push more tags
1 parent fb0b24d commit f21b615

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

.github/workflows/deploy.yaml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- master
7+
- dev
78

89
jobs:
910
build-image:
@@ -23,7 +24,18 @@ jobs:
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

0 commit comments

Comments
 (0)