mirror of
https://github.com/elgohr/Publish-Docker-Github-Action.git
synced 2026-03-12 18:07:12 -04:00
14 lines
259 B
Bash
Executable File
14 lines
259 B
Bash
Executable File
#!/bin/sh -l
|
|
|
|
DOCKER_REPOSITORY=$*
|
|
|
|
BRANCH=$(echo ${GITHUB_REF} | sed -e "s/refs\/heads\///g")
|
|
if [ "${BRANCH}" = "master" ]; then
|
|
BRANCH="latest"
|
|
fi;
|
|
|
|
DOCKERNAME="${DOCKER_REPOSITORY}:${BRANCH}"
|
|
|
|
docker build -t ${DOCKERNAME} .
|
|
docker push ${DOCKERNAME}
|