Skip to content

Add tip for aligning the scale in docs #85

Add tip for aligning the scale in docs

Add tip for aligning the scale in docs #85

# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: .NET
on:
push:
# branches: [ "main" ]
tags:
- '*'
pull_request:
branches: [ "main" ]
env:
IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/levelmeter
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v2
- name: Prepare docker image and tag names
id: prep
run: |
IMAGE_NAME_LOWERCASE=${IMAGE_NAME,,}
echo "Using image name $IMAGE_NAME_LOWERCASE"
PUBLISH_IMAGE=false
TAGS="$IMAGE_NAME_LOWERCASE:dev"
# Define the image that will be used as a cached image
# to speed up the build process
BUILD_CACHE_IMAGE_NAME=${TAGS}
if [[ ${GITHUB_REF} == refs/tags/* ]]; then
LATEST_IMAGE=$IMAGE_NAME_LOWERCASE:latest
VERSION=${GITHUB_REF#refs/tags/}
TAGS="${TAGS},${LATEST_IMAGE},$IMAGE_NAME_LOWERCASE:v${VERSION}"
PUBLISH_IMAGE=true
fi
echo "tags: $TAGS"
echo "publish_image: $PUBLISH_IMAGE"
echo "cache_name: $BUILD_CACHE_IMAGE_NAME"
echo "tags=$TAGS" >> $GITHUB_OUTPUT
echo "publish_image=$PUBLISH_IMAGE" >> $GITHUB_OUTPUT
echo "cache_name=$BUILD_CACHE_IMAGE_NAME" >> $GITHUB_OUTPUT
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v4
with:
context: .
file: "Dockerfile"
tags: ${{ steps.prep.outputs.tags }}
load: true
cache-from: type=registry,ref=${{ steps.prep.outputs.cache_name }}
cache-to: type=inline
push: ${{ steps.prep.outputs.publish_image == 'true' }}
labels: |
org.opencontainers.image.title=${{ github.event.repository.name }}
org.opencontainers.image.description=${{ github.event.repository.description }}
org.opencontainers.image.url=${{ github.event.repository.html_url }}
org.opencontainers.image.revision=${{ github.sha }}
- name: Test recreating all cylinder definitions
run: |
find ./scales/definitions/cylinder*.json | sed -E 's/^\./\/config/g' | xargs -I % docker run -v $(pwd):/config $IMAGE_NAME:dev -c %