Skip to content

Fix docker build and runtime error (#71) #71

Fix docker build and runtime error (#71)

Fix docker build and runtime error (#71) #71

Workflow file for this run

name: Docker Image CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build-and-push:
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Scantools Docker image
run: |
DATE=$(date +%Y-%m-%d)
docker build . --tag ghcr.io/microsoft/lamar-benchmark/scantools:$DATE --target scantools
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
docker tag ghcr.io/microsoft/lamar-benchmark/scantools:$DATE \
ghcr.io/microsoft/lamar-benchmark/scantools:latest
docker push ghcr.io/microsoft/lamar-benchmark/scantools:$DATE
docker push ghcr.io/microsoft/lamar-benchmark/scantools:latest
fi
- name: Build and push Lamar Docker image
run: |
DATE=$(date +%Y-%m-%d)
docker build . --tag ghcr.io/microsoft/lamar-benchmark/lamar:$DATE --target lamar
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
docker tag ghcr.io/microsoft/lamar-benchmark/lamar:$DATE \
ghcr.io/microsoft/lamar-benchmark/lamar:latest
docker push ghcr.io/microsoft/lamar-benchmark/lamar:$DATE
docker push ghcr.io/microsoft/lamar-benchmark/lamar:latest
fi