Skip to content

fixing test issues

fixing test issues #9

Workflow file for this run

name: Build and Publish Container
on:
push:
branches: [ "**" ]
tags: [ "v*" ]
pull_request:
workflow_dispatch:
permissions:
contents: read
packages: write
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Derive image tag from ref
id: img
shell: bash
run: |
RAW_REF="${GITHUB_REF_NAME}"
if [ "${RAW_REF}" = "main" ]; then
TAG="latest"
else
TAG="$(echo "${RAW_REF}" | tr '[:upper:]' '[:lower:]' | sed 's#[^a-z0-9._-]#-#g')"
fi
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
echo "image=ghcr.io/opentransittools/osm:${TAG}" >> "$GITHUB_OUTPUT"
- name: Show resolved image tag
run: |
echo "Ref: $GITHUB_REF"
echo "Image:"
echo "${{ steps.img.outputs.image }}"
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.img.outputs.image }}