This commit is contained in:
2025-10-19 22:57:23 -05:00
parent 4d04f86067
commit 9ee0dbff1d
17 changed files with 1887 additions and 113 deletions
+36
View File
@@ -0,0 +1,36 @@
# Node modules
node_modules/
**/node_modules/
# Build outputs
dist/
build/
out/
*.vsix
# Dependencies
.pnpm-store/
# Test outputs
coverage/
playwright-report/
test-results/
# IDE
.vscode/
.idea/
*.swp
*.swo
# OS
.DS_Store
Thumbs.db
# Git
.git/
.gitignore
# Misc
*.log
.env
.env.*
+35
View File
@@ -0,0 +1,35 @@
# Ubuntu 24.04 LTS (Noble Numbat) - pinned version
FROM ubuntu:24.04
# Set environment variables
ENV NODE_VERSION=22
ENV PNPM_VERSION=10.18.1
ENV DEBIAN_FRONTEND=noninteractive
# Install system dependencies
RUN apt-get update && apt-get install -y \
curl \
wget \
git \
ca-certificates \
gnupg \
&& rm -rf /var/lib/apt/lists/*
# Install Node.js 22
RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - \
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/*
# Enable corepack and setup pnpm
RUN corepack enable \
&& corepack prepare pnpm@${PNPM_VERSION} --activate
# Install Playwright dependencies
# This installs all system dependencies needed for Chromium and Firefox
RUN npx playwright@1.56.1 install --with-deps chromium firefox
# Set working directory
WORKDIR /workspace
# Default command
CMD ["/bin/bash"]
+43
View File
@@ -0,0 +1,43 @@
# Playwright Runner Docker Image
This directory contains a Dockerfile for running Playwright e2e tests in CI/CD.
## Overview
The Docker image is based on **Ubuntu 24.04 LTS (Noble Numbat)** and includes:
- Node.js 22
- pnpm 10.18.1 (via corepack)
- Playwright 1.56.1 with Chromium and Firefox browsers and all system dependencies
## Local Testing
Build the image locally:
```bash
docker build -t jobspeed-playwright-runner:latest -f scripts/Dockerfile .
```
Run e2e tests in the container:
```bash
docker run --rm -e CI=true \
-v $(pwd):/workspace \
-w /workspace/job-application-demo \
jobspeed-playwright-runner:latest \
bash -c "pnpm install --frozen-lockfile && pnpm test:e2e"
```
## CI/CD Usage
The image is automatically built and pushed to GitHub Container Registry (ghcr.io) when:
- Changes are pushed to the `main` branch that affect `scripts/Dockerfile`
- The workflow is manually triggered
The `status-checks.yml` workflow uses this image for running e2e tests, eliminating the need for:
- Manual pnpm setup
- Node.js setup
- Playwright browser installation
## Image Location
The image is published to: `ghcr.io/<repository-owner>/jobspeed-playwright-runner:latest`
+35
View File
@@ -0,0 +1,35 @@
import { build } from 'vite';
import react from '@vitejs/plugin-react';
import path from 'path';
import { fileURLToPath } from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
async function buildUploadPage() {
try {
await build({
root: path.resolve(__dirname, '../src'),
build: {
outDir: path.resolve(__dirname, '../dist'),
emptyOutDir: false, // Don't empty the dir - other files are already there
rollupOptions: {
input: {
upload: path.resolve(__dirname, '../src/upload.html'),
},
output: {
entryFileNames: '[name].js',
chunkFileNames: '[name]-[hash].js',
assetFileNames: '[name].[ext]',
},
},
},
plugins: [react()],
});
console.log('✓ Upload page built successfully');
} catch (error) {
console.error('✗ Error building upload page:', error);
process.exit(1);
}
}
buildUploadPage();