66 lines
1.9 KiB
YAML
66 lines
1.9 KiB
YAML
name: Build and Publish Server Artifacts
|
|
|
|
on: {} # Temporarily disable the trigger to avoid unnecessary builds
|
|
|
|
#on:
|
|
# pull_request: # Change to push when ready to deploy
|
|
# branches:
|
|
# - master
|
|
# paths:
|
|
# - server/**
|
|
# - .github/workflows/server_build.yml
|
|
|
|
jobs:
|
|
server_build:
|
|
name: Build and Publish Server Artifacts
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
variant:
|
|
- name: server-amd64
|
|
platform: linux/amd64
|
|
dockerfile: Dockerfile
|
|
- name: server-arm64
|
|
platform: linux/arm64
|
|
dockerfile: Dockerfile.bookworm
|
|
fail-fast: false
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
# Temporary hotfix for the setup-qemu-action
|
|
# Ref: https://github.com/tonistiigi/binfmt/issues/240
|
|
with:
|
|
platforms: linux/amd64,linux/arm64
|
|
image: tonistiigi/binfmt:qemu-v7.0.0-28
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Build Docker image
|
|
id: build
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: ./server/
|
|
file: ./server/${{ matrix.variant.dockerfile }}
|
|
tags: ${{ matrix.variant.name }}
|
|
platforms: ${{ matrix.variant.platform }}
|
|
load: true
|
|
|
|
- name: Copy artifacts
|
|
run: |
|
|
container_id=$(docker create ${{ matrix.variant.name }})
|
|
mkdir -p artifacts/${{ matrix.variant.name }}
|
|
docker cp $container_id:/src/bin/. artifacts/${{ matrix.variant.name }}/
|
|
docker rm $container_id
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.variant.name }}
|
|
path: artifacts/${{ matrix.variant.name }}
|