actions: Fixed tags
Some checks failed
Build Docker / Build Bot (push) Failing after 22s
Build Docker / Build Master (push) Failing after 23s

This commit is contained in:
Nathan Woodburn 2023-08-24 17:31:40 +10:00
parent bc3f813b29
commit 166e223429
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

View File

@ -23,19 +23,20 @@ jobs:
echo "${{ secrets.DOCKERGIT_TOKEN }}" | docker login git.woodburn.au -u nathanwoodburn --password-stdin
tag_num=$(git rev-parse --short HEAD)
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
if [ "${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" = "master" ]; then
tag=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
if [ tag = "main" ]; then
$tag = "latest"
else
$tag_num = $tag +"-"+ $tag_num
fi
docker build -t hnshosting-master:$tag_num .
docker tag hnshosting-master:$tag_num git.woodburn.au/nathanwoodburn/hnshosting-master:$tag_num
docker push git.woodburn.au/nathanwoodburn/hnshosting-master:$tag_num
docker tag hnshosting-master:$tag_num git.woodburn.au/nathanwoodburn/hnshosting-master:latest
docker push git.woodburn.au/nathanwoodburn/hnshosting-master:latest
else
docker build -t hnshosting-master-dev:$tag_num .
docker tag hnshosting-master-dev:$tag_num git.woodburn.au/nathanwoodburn/hnshosting-master-dev:$tag_num
docker push git.woodburn.au/nathanwoodburn/hnshosting-master-dev:$tag_num
docker tag hnshosting-master-dev:$tag_num git.woodburn.au/nathanwoodburn/hnshosting-master-dev:latest
docker push git.woodburn.au/nathanwoodburn/hnshosting-master-dev:latest
fi
docker tag hnshosting-master:$tag_num git.woodburn.au/nathanwoodburn/hnshosting-master:$tag
docker push git.woodburn.au/nathanwoodburn/hnshosting-master:$tag
@ -59,16 +60,16 @@ jobs:
echo "${{ secrets.DOCKERGIT_TOKEN }}" | docker login git.woodburn.au -u nathanwoodburn --password-stdin
tag_num=$(git rev-parse --short HEAD)
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
if [ "${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" = "master" ]; then
tag=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
if [ tag = "main" ]; then
$tag = "latest"
else
$tag_num = $tag +"-"+ $tag_num
fi
docker build -t hnshosting-bot:$tag_num .
docker tag hnshosting-bot:$tag_num git.woodburn.au/nathanwoodburn/hnshosting-bot:$tag_num
docker push git.woodburn.au/nathanwoodburn/hnshosting-bot:$tag_num
docker tag hnshosting-bot:$tag_num git.woodburn.au/nathanwoodburn/hnshosting-bot:latest
docker push git.woodburn.au/nathanwoodburn/hnshosting-bot:latest
else
docker build -t hnshosting-bot-dev:$tag_num .
docker tag hnshosting-bot-dev:$tag_num git.woodburn.au/nathanwoodburn/hnshosting-bot-dev:$tag_num
docker push git.woodburn.au/nathanwoodburn/hnshosting-bot-dev:$tag_num
docker tag hnshosting-bot-dev:$tag_num git.woodburn.au/nathanwoodburn/hnshosting-bot-dev:latest
docker push git.woodburn.au/nathanwoodburn/hnshosting-bot-dev:latest
fi
docker tag hnshosting-bot:$tag_num git.woodburn.au/nathanwoodburn/hnshosting-bot:$tag
docker push git.woodburn.au/nathanwoodburn/hnshosting-bot:$tag