14 Commits

Author SHA1 Message Date
david 9768ff3517 fix: handle Docker registry authentication gracefully in release workflow
Release / build-and-test (push) Failing after 5m20s
2026-03-31 19:37:34 -07:00
david 0343fa91d2 fix: run unit tests on branch commits, skip main branch
Release / build-and-test (push) Has been cancelled
2026-03-31 19:33:16 -07:00
david b654571a37 feat: add test workflow for every commit
Release / build-and-test (push) Has been cancelled
Test / safe-acceptance-tests (push) Has been cancelled
Test / unit-tests (push) Has been cancelled
2026-03-31 19:30:14 -07:00
david 0090611994 trigger: release with test-capable image
Release / build-and-test (push) Has been cancelled
2026-03-31 19:28:10 -07:00
david 9416159712 feat: build test-capable image, run tests, then build production image
Release / build-and-test (push) Has been cancelled
2026-03-31 19:27:59 -07:00
david d39172ca44 trigger: release workflow
Release / release (push) Has been cancelled
2026-03-31 19:18:13 -07:00
david cd119694ed fix: release workflow should not commit, only tag
Release / release (push) Has been cancelled
2026-03-31 19:18:00 -07:00
david 3e4e896677 trigger: manual workflow trigger for docker.notsosm.art
Release / release (push) Has been cancelled
2026-03-31 19:16:24 -07:00
david 5e2dbbc2be fix: update Docker build script to use docker.notsosm.art registry
Release / release (push) Has been cancelled
2026-03-31 19:16:15 -07:00
david da9c6ae70b fix: update workflow to use docker.notsosm.art registry 2026-03-31 19:16:01 -07:00
david 8cf3f2d401 trigger: manual workflow trigger
Release / release (push) Failing after 11m46s
2026-03-31 18:57:22 -07:00
david 69abec3b87 fix: update workflow to use correct Docker registries
Release / release (push) Has been cancelled
2026-03-31 18:56:11 -07:00
david 92c064c264 feat: add Gitea Actions release workflow
Release / release (push) Has been cancelled
2026-03-31 18:55:11 -07:00
david 59009f0bf7 feat: add view match link to admin matches page 2026-03-31 18:52:06 -07:00
5 changed files with 180 additions and 9 deletions
+87
View File
@@ -0,0 +1,87 @@
name: Release
on:
push:
branches:
- main
env:
REGISTRY: docker.notsosm.art
IMAGE_NAME: euchre-camp
jobs:
build-and-test:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'chore: bump version')"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get current version
id: version
run: |
# Read version from package.json
CURRENT_VERSION=$(node -p "require('./package.json').version")
echo "version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
echo "Current version: $CURRENT_VERSION"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build test-capable image
run: |
docker build \
--target test-runner \
--build-arg GIT_COMMIT=${{ github.sha }} \
-t ${{ env.IMAGE_NAME }}-test:${{ steps.version.outputs.version }} \
.
- name: Run tests inside test-capable container
run: |
docker run --rm \
-e DATABASE_URL="postgresql://user:pass@localhost:5432/dummy" \
${{ env.IMAGE_NAME }}-test:${{ steps.version.outputs.version }} \
npm run test:run
- name: Build production image
run: |
docker build \
--target runner \
--build-arg GIT_COMMIT=${{ github.sha }} \
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }} \
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest \
.
- name: Configure Git
run: |
git config user.name "Gitea Actions"
git config user.email "actions@gitea.com"
- name: Create git tag for release
run: |
git tag -a "v${{ steps.version.outputs.version }}" -m "Release v${{ steps.version.outputs.version }}"
git push origin "v${{ steps.version.outputs.version }}"
- name: Push Docker images
run: |
echo "Pushing to ${{ env.REGISTRY }}..."
# Check if we can authenticate to the registry
if docker login ${{ env.REGISTRY }} -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} 2>/dev/null; then
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
echo "Successfully pushed images to ${{ env.REGISTRY }}"
else
echo "Warning: Could not authenticate to ${{ env.REGISTRY }}"
echo "Images built locally but not pushed to registry"
echo "Manual push required:"
echo " docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}"
echo " docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest"
fi
- name: Deploy to dev (placeholder)
run: |
echo "Deploying version ${{ steps.version.outputs.version }} to dev environment..."
# TODO: Add actual deployment steps
+55
View File
@@ -0,0 +1,55 @@
name: Test
on:
push:
branches:
- '**'
- '!main' # Skip main branch (release workflow handles that)
pull_request:
branches:
- main
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run unit tests
run: npm run test:run
# Acceptance tests that don't require DB read/write
# Only run on pull requests to main
safe-acceptance-tests:
runs-on: ubuntu-latest
needs: unit-tests
if: github.event_name == 'pull_request'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run safe acceptance tests
# These tests should not read/write to the database
# They might test UI components, routing, or static content
run: npm run test:acceptance -- --grep "safe|static|ui|component"
+22 -1
View File
@@ -26,7 +26,28 @@ RUN DATABASE_URL="postgresql://user:pass@localhost:5432/dummy" npx prisma genera
ARG GIT_COMMIT=unknown ARG GIT_COMMIT=unknown
RUN DATABASE_URL="postgresql://user:pass@localhost:5432/dummy" NEXT_PUBLIC_GIT_COMMIT=$GIT_COMMIT npm run build RUN DATABASE_URL="postgresql://user:pass@localhost:5432/dummy" NEXT_PUBLIC_GIT_COMMIT=$GIT_COMMIT npm run build
# Stage 2: Runner # Stage 2: Test runner (includes dev dependencies for testing)
FROM node:20-alpine AS test-runner
# Install dependencies
RUN apk add --no-cache python3 make g++ git
# Set working directory
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install ALL dependencies (including dev dependencies for testing)
RUN npm ci
# Copy source code
COPY . .
# Generate Prisma client
RUN DATABASE_URL="postgresql://user:pass@localhost:5432/dummy" npx prisma generate
# Stage 3: Production runner
FROM node:20-alpine AS runner FROM node:20-alpine AS runner
# Install dumb-init for proper signal handling # Install dumb-init for proper signal handling
+1 -1
View File
@@ -14,7 +14,7 @@ const fs = require('fs');
const path = require('path'); const path = require('path');
// Configuration // Configuration
const REGISTRY = 'euchre-camp'; const REGISTRY = 'docker.notsosm.art';
const IMAGE_NAME = 'euchre-camp'; const IMAGE_NAME = 'euchre-camp';
const FULL_IMAGE_NAME = `${REGISTRY}/${IMAGE_NAME}`; const FULL_IMAGE_NAME = `${REGISTRY}/${IMAGE_NAME}`;
+8
View File
@@ -168,6 +168,13 @@ export default function AdminMatchesPage() {
{match.team2Score} {match.team2Score}
</td> </td>
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-500"> <td className="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<div className="flex gap-3">
<Link
href={`/matches/${match.id}`}
className="text-blue-600 hover:text-blue-900"
>
View
</Link>
<button <button
onClick={() => handleDelete(match.id)} onClick={() => handleDelete(match.id)}
disabled={deletingId === match.id} disabled={deletingId === match.id}
@@ -175,6 +182,7 @@ export default function AdminMatchesPage() {
> >
{deletingId === match.id ? "Deleting..." : "Delete"} {deletingId === match.id ? "Deleting..." : "Delete"}
</button> </button>
</div>
</td> </td>
</tr> </tr>
))} ))}