Files
Excalidraw/.github/workflows/docker-build-dev.yml
T
Tomas Dvorak a07fca997e fix: CI/CD test failures and invalid Go version
- Fix go.mod Go version from invalid 1.25.7 to 1.23
- Fix Dockerfile golang image from 1.25 to 1.23
- Add window.matchMedia mock for jsdom themeStore tests
- Exclude e2e/ from Vitest to prevent Playwright test conflicts
- Add frontend test step to both CI workflows
2026-04-27 09:04:30 +02:00

93 lines
2.4 KiB
YAML

name: Build and Push Docker Image for Preview
on:
push:
pull_request:
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: excalidraw-full-preview
OWNER: betterandbetterii
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Run Go tests
run: go test ./... -v -count=1
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Install frontend deps
run: cd frontend && npm ci --legacy-peer-deps
- name: Build frontend
run: cd frontend && npm run build
- name: Run frontend tests
run: cd frontend && npm test -- --run
build-and-push:
needs: test
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable={{is_default_branch}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./excalidraw-full.Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.IMAGE_NAME }}:buildcache
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.IMAGE_NAME }}:buildcache,mode=max