mirror of
https://github.com/Shik3i/KoalaSync.git
synced 2026-07-26 12:08:15 +00:00
97 lines
2.8 KiB
YAML
97 lines
2.8 KiB
YAML
name: Beta Server Image
|
|
|
|
# Publishes the relay server as a Docker image under NON-production tags so a
|
|
# feature branch can be deployed to a staging/backup server and used as a custom
|
|
# server, without ever touching the ':latest' tag the official relay tracks.
|
|
#
|
|
# Tags produced (on ghcr.io/<owner>/<repo>):
|
|
# - beta moving channel pointer to the newest build
|
|
# - <branch-slug> e.g. feature-textchat
|
|
# - sha-<short-commit> immutable, pin to an exact build
|
|
# - <custom> only on manual run, e.g. chatbeta01
|
|
# Never ':latest' (flavor: latest=false).
|
|
#
|
|
# Remove this workflow once the feature is merged & released the normal way.
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- feature/textchat
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag:
|
|
description: 'Extra immutable tag for this build (e.g. chatbeta01). Optional.'
|
|
required: false
|
|
default: ''
|
|
|
|
concurrency:
|
|
group: beta-image-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build-beta-image:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v7
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: '24'
|
|
cache: 'npm'
|
|
cache-dependency-path: |
|
|
package-lock.json
|
|
server/package-lock.json
|
|
|
|
- name: Install root dependencies
|
|
run: npm ci
|
|
|
|
- name: Install server dependencies
|
|
run: npm ci
|
|
working-directory: server
|
|
|
|
- name: Run verification suite
|
|
run: npm run verify
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v4
|
|
|
|
- name: Log in to GitHub Container Registry
|
|
uses: docker/login-action@v4
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Extract Docker metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v6
|
|
with:
|
|
images: ghcr.io/${{ github.repository }}
|
|
# Never publish ':latest' from a beta build.
|
|
flavor: |
|
|
latest=false
|
|
tags: |
|
|
type=raw,value=beta
|
|
type=ref,event=branch
|
|
type=sha,prefix=sha-
|
|
type=raw,value=${{ github.event.inputs.tag }},enable=${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag != '' }}
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v7
|
|
with:
|
|
context: .
|
|
file: server/Dockerfile
|
|
push: true
|
|
platforms: linux/amd64,linux/arm64
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|