docker: Tag with git commit hash
All checks were successful
Build Docker / CheckFiles (push) Successful in 9s
Build Docker / Build Docker (push) Successful in 21s

This commit is contained in:
Nathan Woodburn 2023-07-28 14:33:16 +10:00
parent c23cef24df
commit c37c7aadcd
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

View File

@ -37,7 +37,7 @@ jobs:
apt-get update apt-get update
apt-get install docker-ce-cli -y apt-get install docker-ce-cli -y
echo "${{ secrets.DOCKERGIT_TOKEN }}" | docker login git.woodburn.au -u nathanwoodburn --password-stdin echo "${{ secrets.DOCKERGIT_TOKEN }}" | docker login git.woodburn.au -u nathanwoodburn --password-stdin
tag_num=$(git rev-list --count main) tag_num=$(git rev-parse --short HEAD)
docker build -t woodburn:$tag_num . docker build -t woodburn:$tag_num .
docker tag woodburn:$tag_num git.woodburn.au/nathanwoodburn/woodburn:$tag_num docker tag woodburn:$tag_num git.woodburn.au/nathanwoodburn/woodburn:$tag_num
docker push git.woodburn.au/nathanwoodburn/woodburn:$tag_num docker push git.woodburn.au/nathanwoodburn/woodburn:$tag_num