Skip to content

fix: keep workspace and team context in sync #4

fix: keep workspace and team context in sync

fix: keep workspace and team context in sync #4

name: Publish GHCR Image
on:
push:
tags:
- "v*"
permissions:
contents: read
packages: write
jobs:
publish:
name: Build and Publish Image
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set image name
run: echo "IMAGE_NAME=ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/simprint-server" >> "$GITHUB_ENV"
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=ref,event=tag
type=match,pattern=v(.*),group=1
type=raw,value=latest
type=sha,prefix=sha-
- name: Build release binary in Debian Bullseye
run: |
docker run --rm \
-v "$PWD:/workspace" \
-w /workspace \
rust:1.88-bullseye \
bash -c '
export PATH="/usr/local/cargo/bin:/usr/local/rustup/bin:$PATH" &&
apt-get update &&
apt-get install -y --no-install-recommends pkg-config libssl-dev &&
cargo --version &&
cargo build --release --bin simprint-server
'
- name: Prepare Docker build context
run: |
rm -rf .dist/docker-context
mkdir -p .dist/docker-context
cp Dockerfile .dist/docker-context/
cp docker-compose.yml .dist/docker-context/
cp .dockerignore .dist/docker-context/
cp target/release/simprint-server .dist/docker-context/simprint-server
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push image
uses: docker/build-push-action@v6
with:
context: .dist/docker-context
file: .dist/docker-context/Dockerfile
push: true
platforms: linux/amd64
build-args: |
BINARY_NAME=simprint-server
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}