This repository has been archived by the owner on Aug 22, 2024. It is now read-only.
move _health endpoint to own router without session #67
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish to Docker Hub | |
env: | |
DOCKER_IMAGE: ghcr.io/elseu/sdu-oidc-jwt-provider | |
on: | |
push: | |
tags: | |
- "v*" | |
branches: | |
- master | |
- develop | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Log in with Docker Hub | |
run: echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin | |
- name: Build docker image | |
run: docker build -t $DOCKER_IMAGE . | |
- name: Push to latest | |
if: github.ref == 'refs/heads/master' | |
run: docker tag $DOCKER_IMAGE $DOCKER_IMAGE:latest && docker push $DOCKER_IMAGE:latest | |
- name: Push to develop | |
if: github.ref == 'refs/heads/develop' | |
run: docker tag $DOCKER_IMAGE $DOCKER_IMAGE:next && docker push $DOCKER_IMAGE:next | |
- name: Push to versions | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
VERSION_SUFFIX=$(echo ${GITHUB_REF/refs\/tags\/v/} | sed -E s/[^-]+//) | |
MAJOR_VERSION=$(echo ${GITHUB_REF/refs\/tags\/v/} | sed -E s/^\([0-9]+\).*$/\\1/ | sed -E s/-.*$//) | |
MINOR_VERSION=$(echo ${GITHUB_REF/refs\/tags\/v/} | sed -E s/^\([0-9]+\.[0-9]+\).*$/\\1/ | sed -E s/-.*$//) | |
FULL_VERSION=$(echo ${GITHUB_REF/refs\/tags\/v/} | sed -E s/^\([0-9]+\.[0-9]+\.[0-9]+\).*$/\\1/ | sed -E s/-.*$//) | |
if [ ! -z "$MAJOR_VERSION" ]; then | |
docker tag $DOCKER_IMAGE $DOCKER_IMAGE:$MAJOR_VERSION$VERSION_SUFFIX && docker push $DOCKER_IMAGE:$MAJOR_VERSION$VERSION_SUFFIX | |
fi | |
if [ ! -z "$MINOR_VERSION" ]; then | |
docker tag $DOCKER_IMAGE $DOCKER_IMAGE:$MINOR_VERSION$VERSION_SUFFIX && docker push $DOCKER_IMAGE:$MINOR_VERSION$VERSION_SUFFIX | |
fi | |
if [ ! -z "$FULL_VERSION" ]; then | |
docker tag $DOCKER_IMAGE $DOCKER_IMAGE:$FULL_VERSION$VERSION_SUFFIX && docker push $DOCKER_IMAGE:$FULL_VERSION$VERSION_SUFFIX | |
fi |