36cbf6df58
Build and Deploy / build-and-push (push) Successful in 9m33s
whats_new_plugin embeds the changelog at compile time
(include_str!("../../CHANGELOG.md"), shipped 2026-07-13), but the
Dockerfile's wasm-builder stage copies an explicit file list that
never included CHANGELOG.md — every docker-build since (10 runs,
v0.48.x and v0.49.0 content) failed in build_wasm.sh while web-e2e
(full checkout) stayed green, so the web has been serving the
July 14 image.
Also add CHANGELOG.md to the workflow's trigger paths so changelog
cuts redeploy the web and the What's-new card stays fresh.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
96 lines
3.2 KiB
YAML
96 lines
3.2 KiB
YAML
# Build and deploy the solitaire server Docker image. (retriggered 2026-07-16)
|
|
name: Build and Deploy
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
paths:
|
|
- 'solitaire_server/**'
|
|
- 'solitaire_wasm/**'
|
|
- 'solitaire_web/**'
|
|
- 'solitaire_sync/**'
|
|
- 'solitaire_core/**'
|
|
- 'solitaire_data/**'
|
|
- 'solitaire_engine/**'
|
|
- 'Cargo.toml'
|
|
- 'Cargo.lock'
|
|
- 'build_wasm.sh'
|
|
# The engine embeds CHANGELOG.md (What's-new card) — changelog cuts
|
|
# must redeploy the web so the card content stays fresh.
|
|
- 'CHANGELOG.md'
|
|
- 'solitaire_server/Dockerfile'
|
|
- '.gitea/workflows/docker-build.yml'
|
|
|
|
env:
|
|
REGISTRY: git.aleshym.co
|
|
IMAGE: git.aleshym.co/funman300/solitaire-server
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
# Need full history so we can push the tag-update commit back.
|
|
fetch-depth: 0
|
|
token: ${{ secrets.CI_TOKEN }}
|
|
|
|
- name: Set image tag
|
|
id: meta
|
|
run: echo "sha=${GITHUB_SHA::8}" >> "$GITHUB_OUTPUT"
|
|
|
|
# The wasm bundles (solitaire_server/web/pkg/) are not in the repo —
|
|
# the Dockerfile's wasm-builder stage builds them from source inside
|
|
# this image build, so the deployed image always ships fresh wasm.
|
|
|
|
- name: Log in to Gitea registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ gitea.actor }}
|
|
password: ${{ secrets.CI_TOKEN }}
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
with:
|
|
driver-opts: network=host
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
file: solitaire_server/Dockerfile
|
|
push: true
|
|
tags: |
|
|
${{ env.IMAGE }}:${{ steps.meta.outputs.sha }}
|
|
${{ env.IMAGE }}:latest
|
|
cache-from: type=registry,ref=${{ env.IMAGE }}:buildcache
|
|
cache-to: type=registry,ref=${{ env.IMAGE }}:buildcache,mode=max
|
|
|
|
- name: Install kustomize
|
|
run: |
|
|
curl -sL https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv5.4.3/kustomize_v5.4.3_linux_amd64.tar.gz | tar xz
|
|
sudo mv kustomize /usr/local/bin/kustomize
|
|
|
|
- name: Pin image tag and push to deploy branch
|
|
run: |
|
|
git config user.email "ci@gitea.local"
|
|
git config user.name "Gitea CI"
|
|
# Switch to the deploy branch, creating it from the current HEAD if absent.
|
|
# Use 'git switch' (branch-only) to avoid ambiguity with the deploy/ directory.
|
|
if git fetch origin deploy 2>/dev/null; then
|
|
git switch deploy
|
|
else
|
|
git switch -c deploy
|
|
fi
|
|
# Update the pinned image tag.
|
|
cd deploy
|
|
kustomize edit set image solitaire-server=${{ env.IMAGE }}:${{ steps.meta.outputs.sha }}
|
|
cd ..
|
|
git add deploy/kustomization.yaml
|
|
git diff --cached --quiet && exit 0
|
|
git commit -m "chore(deploy): bump image to ${{ steps.meta.outputs.sha }} [skip ci]"
|
|
git push origin deploy
|