Skip to content

Merge pull request #30 from eulynx-live/SCI-IO #109

Merge pull request #30 from eulynx-live/SCI-IO

Merge pull request #30 from eulynx-live/SCI-IO #109

Workflow file for this run

name: Docker Image CI
on:
push:
branches: [ "main" ]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
include:
- subsystem: LightSignal
image: light-signal
- subsystem: Point
image: point
- subsystem: TrainDetectionSystem
image: train-detection-system
- subsystem: LevelCrossing
image: level-crossing
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore src/${{ matrix.subsystem }}
- name: Build
run: dotnet publish -c Release --no-restore src/${{ matrix.subsystem }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/${{ matrix.image }}
tags: |
type=ref,event=branch
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
platforms: linux/amd64,linux/arm64/v8
file: docker/${{ matrix.subsystem }}/Dockerfile
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}