Skip to content

Add basic setup

Add basic setup #2

# Build the Docker image to make sure it works
name: docker-build-test
on:
pull_request:
branches:
- main
paths:
# See `.dockerignore` for more details.
- ".github/workflows/docker-build-test.yaml" # Include workflow itself
- ".dockerignore"
- "Dockerfile"
- "go.mod"
- "go.sum"
- "cmd/**"
- "data/**"
- "internal/**"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3
- name: build Docker image
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6
with:
context: .
push: false
load: true
tags: test-${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: test Docker image
run: |
docker image ls
docker run --rm test-${{ github.sha }} --version || true
echo "✅ Docker image built successfully!"