Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
NEXT_PUBLIC_GA_ID=G-JE322K8EBK
BASEPATH=
# Local dev onlyCI sets this per workflow (prod vs develop).
# Local / Vercelset per environment (prod vs develop).
NEXT_PUBLIC_APP_URL=https://2026.pycon.co
# Certificates registry (build-time only; do not use NEXT_PUBLIC_*).
# Certificates registry (server-side only; do not use NEXT_PUBLIC_*).
# Either works: raw file id, OR a Drive share/view/open URL (id is extracted).
# CERTIFICATES_DRIVE_FILE_ID=1kcQ-CP2o-b_Xq4w323U3h_nSrn6FOGCD
# CERTIFICATES_DRIVE_FILE_ID=https://drive.google.com/file/d/1kcQ-CP2o-b_Xq4w323U3h_nSrn6FOGCD/view?usp=sharing
# Optional direct download URL (Drive view/share links are auto-rewritten):
# CERTIFICATES_JSON_URL=https://drive.usercontent.google.com/download?id=FILE_ID&export=download
CERTIFICATES_DRIVE_FILE_ID=
CERTIFICATES_DRIVE_FILE_ID=
66 changes: 5 additions & 61 deletions .github/workflows/ci-dev.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy static content to website-develop
name: CI (develop)

# GitHub Actions is non-TTY; these make Node/Next (chalk) and similar tools emit ANSI colors
# that render in the Actions log viewer.
Expand All @@ -17,11 +17,9 @@ on:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages-dev"
group: "ci-dev"
cancel-in-progress: true

jobs:
Expand Down Expand Up @@ -64,7 +62,7 @@ jobs:
node-version: "22"
- name: Install dependencies
run: npm install
- name: Set Pages environment
- name: Set build environment
shell: bash
run: |
GA_ID="${{ vars.NEXT_PUBLIC_GA_ID }}"
Expand All @@ -74,8 +72,6 @@ jobs:
if [ -n "$GA_ID" ]; then
echo "NEXT_PUBLIC_GA_ID=$GA_ID" >> "$GITHUB_ENV"
fi
echo "BASEPATH=${{ vars.BASEPATH }}" >> "$GITHUB_ENV"
echo "NEXT_PUBLIC_BASEPATH=${{ vars.BASEPATH }}" >> "$GITHUB_ENV"
echo "NEXT_PUBLIC_APP_URL=https://develop.pycon.co" >> "$GITHUB_ENV"
if [ -n "${{ secrets.CERTIFICATES_JSON_URL }}" ]; then
echo "CERTIFICATES_JSON_URL=${{ secrets.CERTIFICATES_JSON_URL }}" >> "$GITHUB_ENV"
Expand All @@ -86,59 +82,7 @@ jobs:
elif [ -n "${{ vars.CERTIFICATES_DRIVE_FILE_ID }}" ]; then
echo "CERTIFICATES_DRIVE_FILE_ID=${{ vars.CERTIFICATES_DRIVE_FILE_ID }}" >> "$GITHUB_ENV"
fi
- name: Typecheck
run: npm run check-types
- name: Build project
run: npm run build
- name: Upload dist folder as artifact
uses: actions/upload-artifact@v4
with:
name: dist-artifact
path: out/
# Required so `public/.nojekyll` → `out/.nojekyll` is included. Without it, GitHub Pages
# Jekyll ignores `_next/` and every chunk returns 404.
include-hidden-files: true

deploy:
if: github.event_name == 'push'
name: Deploy to Develop
runs-on: ubuntu-latest
needs: build
steps:
- name: Generate access token
if: always()
id: generate_access_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.PYCON_CO_APP_ID }}
private-key: ${{ secrets.PYCON_CO_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Checkout target repository
uses: actions/checkout@v4
with:
repository: PyConColombia/website-develop
token: ${{ steps.generate_access_token.outputs.token }}
path: website-develop
- name: Download dist artifact
uses: actions/download-artifact@v4
with:
name: dist-artifact
path: out
- name: Prepare deployment
run: |
find website-develop/ -mindepth 1 ! -name 'CNAME' ! -path "website-develop/.git*" -delete
# `mv out/*` skips dotfiles; `.nojekyll` must be present or GitHub Pages ignores `_next/`.
cp -a out/. website-develop/
# Belt-and-suspenders: artifact uploads omit dotfiles unless include-hidden-files is set;
# an empty file is enough to disable Jekyll for the whole site.
touch website-develop/.nojekyll
- name: Commit and push changes
run: |
cd website-develop
git config user.name "github-actions"
git config user.email "github-actions@github.com"
if [[ -n "$(git status --porcelain)" ]]; then
git add .
git commit -m "Deploy: $(date +'%Y-%m-%d %H:%M:%S') to branch ${{ github.ref_name }}"
git push origin gh-pages
else
echo "No changes to commit. Skipping deployment."
fi
35 changes: 13 additions & 22 deletions .github/workflows/ci-prod.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,35 @@
name: Deploy static content to website-2026
name: CI (production)

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages-prod"
group: "ci-prod"
cancel-in-progress: true

jobs:
deploy:
name: Deploy to Production
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: 25.2
node-version: "22"
- name: Install dependencies
run: npm install
- name: Set Pages environment
- name: Set build environment
shell: bash
run: |
GA_ID="${{ vars.NEXT_PUBLIC_GA_ID }}"
Expand All @@ -41,8 +39,6 @@ jobs:
if [ -n "$GA_ID" ]; then
echo "NEXT_PUBLIC_GA_ID=$GA_ID" >> "$GITHUB_ENV"
fi
echo "BASEPATH=${{ vars.BASEPATH }}" >> "$GITHUB_ENV"
echo "NEXT_PUBLIC_BASEPATH=${{ vars.BASEPATH }}" >> "$GITHUB_ENV"
echo "NEXT_PUBLIC_APP_URL=https://2026.pycon.co" >> "$GITHUB_ENV"
if [ -n "${{ secrets.CERTIFICATES_JSON_URL }}" ]; then
echo "CERTIFICATES_JSON_URL=${{ secrets.CERTIFICATES_JSON_URL }}" >> "$GITHUB_ENV"
Expand All @@ -53,14 +49,9 @@ jobs:
elif [ -n "${{ vars.CERTIFICATES_DRIVE_FILE_ID }}" ]; then
echo "CERTIFICATES_DRIVE_FILE_ID=${{ vars.CERTIFICATES_DRIVE_FILE_ID }}" >> "$GITHUB_ENV"
fi
- name: Format check
run: npm run format:check
- name: Typecheck
run: npm run check-types
- name: Build
run: npm run build
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./out
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ yarn-error.log*
next-env.d.ts

.tmp/

# pnpm
pnpm-lock.yaml
65 changes: 30 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# website-2026

React + Vite project with HMR, ESLint, and Biome for formatting.
Next.js site for PyCon Colombia 2026. Deployed on [Vercel](https://vercel.com).

## Prerequisites

- **Node.js** 18+ (recommended: current LTS)
- **npm** 9+ (or use the Node-bundled version)
- **Node.js** 22+ (recommended: current LTS)
- **npm** 9+

## Setup & run

Expand All @@ -15,61 +15,56 @@ React + Vite project with HMR, ESLint, and Biome for formatting.
npm install
```

### 2. Run the development server
### 2. Environment

```bash
npm run dev
```

Then open the URL shown in the terminal (usually `http://localhost:5173`).

## Deploy en GitHub Pages
Copy `.env.example` to `.env.local` and set at least:

Este proyecto ya esta configurado para exportacion estatica de Next.js y despliegue automatico con GitHub Actions.
- `NEXT_PUBLIC_APP_URL` — local site URL (e.g. `http://localhost:3000`)
- `CERTIFICATES_DRIVE_FILE_ID` or `CERTIFICATES_JSON_URL` — certificates registry (server-only)

1. Crea un repositorio en GitHub.
2. Conecta este proyecto al repositorio real:
### 3. Development server

```bash
git remote set-url origin https://github.com/TU_USUARIO/TU_REPO.git
git add .
git commit -m "Prepare GitHub Pages deploy"
git push -u origin main
npm run dev
```

3. En GitHub, entra a `Settings` -> `Pages`.
4. En `Build and deployment`, selecciona `GitHub Actions` como fuente.
5. Abre la pestana `Actions` y espera a que termine `Deploy to GitHub Pages`.

Si el repositorio se llama `TU_USUARIO.github.io`, la web quedara en `https://TU_USUARIO.github.io/`. Si usa otro nombre, quedara en `https://TU_USUARIO.github.io/TU_REPO/`.

## Table of Contents 📋
Open `http://localhost:3000`.

### 3. Build for production
### 4. Production build

```bash
npm run build
npm start
```

Output is in the `dist/` folder.
## Deploy on Vercel

### 4. Preview production build locally
1. Import the GitHub repo in the [Vercel dashboard](https://vercel.com/new).
2. Framework preset: **Next.js** (auto-detected).
3. Add environment variables (Production + Preview as needed):
- `NEXT_PUBLIC_APP_URL` — e.g. `https://2026.pycon.co` / `https://develop.pycon.co`
- `NEXT_PUBLIC_GA_ID` (optional)
- `CERTIFICATES_DRIVE_FILE_ID` or `CERTIFICATES_JSON_URL`
- Leave `BASEPATH` empty unless the app is served under a subpath
4. Point custom domains (`2026.pycon.co`, preview/develop) at the Vercel project.
5. Push to `main` / `develop` — Vercel deploys; GitHub Actions only runs CI (format, types, build).

```bash
npm run preview
```
Certificate pages (`/certificates/[id]/`) are rendered on demand: the server validates the id against the Drive JSON before returning the page. No static HTML is generated per certificate.

## Other scripts
## Scripts

| Script | Description |
| ---------------------- | --------------------------- |
| `npm run dev` | Next.js dev server |
| `npm run build` | Production build |
| `npm start` | Serve production build |
| `npm run format` | Format and fix with Biome |
| `npm run format:check` | Check formatting (no write) |
| `npm run check-types` | TypeScript check |

## Tech stack

- [Next.js](https://nextjs.org/) 16 (App Router)
- [React](https://react.dev/) 19
- [Vite](https://vite.dev/) 7
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react-swc) for Fast Refresh
- [Tailwind CSS](https://tailwindcss.com/) 4
- [Biome](https://biomejs.dev/) for linting and formatting
- ESLint for additional lint rules
2 changes: 0 additions & 2 deletions next.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import type { NextConfig } from "next";

const nextConfig: NextConfig = {
output: "export",
basePath: process.env.BASEPATH ?? "",
assetPrefix: process.env.BASEPATH ?? "",
images: {
unoptimized: true,
remotePatterns: [
{
protocol: "https",
Expand Down
Loading
Loading