use branch name as tag name

This commit is contained in:
Robert Resch 2021-07-05 12:39:17 +02:00
parent fbe035a723
commit 76f45225d9
No known key found for this signature in database
GPG key ID: 6B360759EB2ACAEE

View file

@ -2,9 +2,6 @@ name: Build docker images
on:
push:
branches:
- master
- next
jobs:
build:
@ -13,6 +10,19 @@ jobs:
- name: checkout code
uses: actions/checkout@v2
- name: Get tag name
shell: bash
run: |
branch=$(echo ${GITHUB_REF#refs/heads/});
if [ -z $BRANCH ]; then
exit 1;
elif [ $BRANCH == "master" ]; then
branch=latest;
fi
echo "##[set-output name=tag;]$(echo $branch)"
id: tag_name
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
@ -28,5 +38,5 @@ jobs:
- name: build the image
run: |
docker buildx build --push \
--tag edenhaus/bumper:latest \
--tag edenhaus/bumper:${{ steps.tag_name.outputs.tag }} \
--platform linux/amd64,linux/arm/v7,linux/arm64 .