Skip to content

[feat]: added feature to add auth flag for backend from values. #145 … #42

[feat]: added feature to add auth flag for backend from values. #145 …

[feat]: added feature to add auth flag for backend from values. #145 … #42

Workflow file for this run

# publish docker image
# - https://docs.github.com/en/free-pro-team@latest/actions/guides/publishing-docker-images
# - https://github.com/docker/build-push-action
name: Build & Push
on:
workflow_dispatch:
inputs:
version:
description: 'Version (optional)'
required: false
push:
tags:
- v*
jobs:
build_and_push:
name: Build & Push
runs-on: ubuntu-latest
steps:
- name: Set variables
id: variables
run: |
PROJECT="kore-board"
VERSION="${{ github.event.inputs.version }}"
REGISTRY="ghcr.io/${{ github.repository_owner }}"
if [[ $VERSION == "" ]]; then
GITHUB_REF="${{ github.ref }}"
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
elif [[ $GITHUB_REF == refs/heads/* ]]; then
VERSION="$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g')-$(date '+%Y%m%d')"
elif [[ $GITHUB_REF == refs/pull/* ]]; then
VERSION="pr-${{ github.event.number }}"
fi
fi
echo ::set-output name=prefix::${REGISTRY}/${PROJECT}
echo ::set-output name=version::${VERSION}
- name: Check out the repository
uses: actions/checkout@v2
- name: Login GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Build docker image [backend]
uses: docker/build-push-action@v2
with:
context: src/app/backend
file: src/app/backend/Dockerfile
push: true
tags: |
${{steps.variables.outputs.prefix}}.backend:${{steps.variables.outputs.version}}
${{steps.variables.outputs.prefix}}.backend:latest
- name: Build docker image [frontend]
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: |
${{steps.variables.outputs.prefix}}.frontend:${{steps.variables.outputs.version}}
${{steps.variables.outputs.prefix}}.frontend:latest
- name: Build docker image [metrics-scraper]
uses: docker/build-push-action@v2
with:
context: src/app/metrics-scraper
file: src/app/metrics-scraper/Dockerfile
push: true
tags: |
${{steps.variables.outputs.prefix}}.metrics-scraper:${{steps.variables.outputs.version}}
${{steps.variables.outputs.prefix}}.metrics-scraper:latest
- name: Build docker image [terminal]
uses: docker/build-push-action@v2
with:
context: src/app/terminal
file: src/app/terminal/Dockerfile
push: true
tags: |
${{steps.variables.outputs.prefix}}.terminal:${{steps.variables.outputs.version}}
${{steps.variables.outputs.prefix}}.terminal:latest