Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added admin features #64

Merged
merged 11 commits into from
Dec 26, 2019
Prev Previous commit
Next Next commit
Update action to tag based on branch name also
  • Loading branch information
antoniomika committed Dec 24, 2019
commit 1a0f9ce57749a6f871e045858adfdff0c4ce585a
6 changes: 4 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ jobs:
run: echo ${DOCKER_PASSWORD} | docker login -u ${DOCKER_USERNAME} --password-stdin
- name: Build and push the Docker images
run: |
BRANCH_NAME="${GITHUB_REF#refs/heads/}"
DATE="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
REF="${BRANCH_NAME:-master}"
OTHER_TAGS=""
REF="master"
if [[ ${GITHUB_REF} =~ ^refs\/tags\/v.*$ ]]
then
REF="${GITHUB_REF//refs\/tags\/}"
OTHER_TAGS="${OTHER_TAGS} -t ${GITHUB_REPOSITORY}:${REF} -t ${GITHUB_REPOSITORY}:latest"
OTHER_TAGS="${OTHER_TAGS} -t ${GITHUB_REPOSITORY}:latest"
fi

docker buildx build \
Expand All @@ -37,4 +38,5 @@ jobs:
--build-arg COMMIT=${GITHUB_SHA} \
--build-arg DATE=${DATE} \
-t ${GITHUB_REPOSITORY}:${GITHUB_SHA} \
-t ${GITHUB_REPOSITORY}:${REF} \
${OTHER_TAGS} .