mirror of
https://github.com/Moepchi/webspeak3.git
synced 2026-12-01 00:42:49 +08:00
ci: build and push Docker image on release
Adds a GitHub Actions workflow (docker-publish.yml) that builds the webspeak3 image and pushes it to Docker Hub as moepchi/webspeak3:latest plus a matching version tag whenever a GitHub Release is published (or manually via workflow_dispatch). Uses GHA layer caching so the Rust connector build doesn't redo work on every release. Also hardens the Dockerfile's web-builder stage against a long-standing npm bug (npm/cli#4828) where `npm ci` intermittently fails to install Vite 8's platform-specific Rolldown binding without a non-zero exit code, surfacing later as a confusing vite build MODULE_NOT_FOUND. Now verified and self-healed (rm + npm install) before the real build runs. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a6e2130d29
commit
b14292a95d
2 files changed
+61
No files matched your search
@@ -0,0 +1,52 @@
|
||||
name: Build and publish Docker image
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: docker-publish-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
name: Build and push moepchi/webspeak3
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Determine image tags
|
||||
id: tags
|
||||
run: |
|
||||
TAGS="moepchi/webspeak3:latest"
|
||||
if [ "${{ github.event_name }}" = "release" ]; then
|
||||
TAGS="$TAGS,moepchi/webspeak3:${{ github.event.release.tag_name }}"
|
||||
fi
|
||||
echo "tags=$TAGS" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.tags.outputs.tags }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
Reference in new issue
Block a user