Skip to content

Update versions

Update versions #26

Workflow file for this run

name: docker
on:
push:
branches:
- develop
- feature/*
- master
tags:
- '*'
jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Compute Tags
id: compute_tags
run: |
branch="${GITHUB_REF#refs/heads/}"
tag="${GITHUB_REF#refs/tags/}"
if [ "$branch" != "$GITHUB_REF" ]; then
branch="$(echo "$branch" | sed -e 's/[^a-zA-Z0-9\-\.]/-/g')"
echo "::set-output name=TAGS::boxboat/okta-nginx:commit-${branch}"
elif [ "$tag" != "$GITHUB_REF" ]; then
latest=""
if ! echo "$tag" | grep -qF '-'; then
latest=",boxboat/okta-nginx:latest"
fi
tag="$(echo "$tag" | sed -e 's/[^a-zA-Z0-9\-\.]/-/g')"
echo "::set-output name=TAGS::boxboat/okta-nginx:${tag}${latest}"
else
echo "unable to determine tag" >&2
exit 1
fi
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: "${{ steps.compute_tags.outputs.TAGS }}"