Skip to content

Commit 79f023c

Browse files
committed
Deploy static Next.js research site with weekly content updates
1 parent 62eb5f0 commit 79f023c

494 files changed

Lines changed: 15788 additions & 66 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/jekyll.yml‎

Lines changed: 0 additions & 65 deletions
This file was deleted.

‎.github/workflows/pages.yml‎

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Update content and deploy Next.js to Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
schedule:
7+
# Brasília is UTC-3: Monday 09:00 = Monday 12:00 UTC.
8+
- cron: '0 12 * * 1'
9+
workflow_dispatch:
10+
inputs:
11+
refresh_content:
12+
description: 'Update stored content before deploying (Apify runs at most once per source per week)'
13+
type: boolean
14+
default: true
15+
16+
permissions:
17+
contents: write
18+
pages: write
19+
id-token: write
20+
21+
concurrency:
22+
group: pages
23+
cancel-in-progress: false
24+
25+
jobs:
26+
build:
27+
runs-on: ubuntu-latest
28+
timeout-minutes: 40
29+
steps:
30+
- uses: actions/checkout@v4
31+
with:
32+
ref: main
33+
fetch-depth: 0
34+
- uses: actions/setup-node@v4
35+
with:
36+
node-version: '22'
37+
cache: npm
38+
cache-dependency-path: web/package-lock.json
39+
- uses: actions/setup-python@v5
40+
with:
41+
python-version: '3.12'
42+
- name: Install dependencies
43+
working-directory: web
44+
run: npm ci
45+
- name: Update stored content
46+
if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.refresh_content)
47+
working-directory: web
48+
continue-on-error: true
49+
env:
50+
APIFY_TOKEN: ${{ secrets.APIFY_TOKEN }}
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
run: npm run sync:weekly
53+
- name: Commit only changed content
54+
if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.refresh_content)
55+
run: |
56+
git add web/data/publications.json web/data/projects.json web/data/people.json web/data/media
57+
if ! git diff --cached --quiet; then
58+
git config user.name 'github-actions[bot]'
59+
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
60+
git commit -m 'Update stored research group content [skip ci]'
61+
# Never force-push: incorporate concurrent changes or fail on a conflict.
62+
git fetch origin main
63+
git rebase origin/main
64+
git push origin HEAD:main
65+
fi
66+
# GITHUB_TOKEN commits do not trigger another push workflow.
67+
- name: Configure Pages
68+
id: pages
69+
uses: actions/configure-pages@v5
70+
- name: Export static site
71+
working-directory: web
72+
env:
73+
NEXT_PUBLIC_BASE_PATH: ${{ steps.pages.outputs.base_path }}
74+
run: npm run build
75+
- name: Check exported routes and local assets
76+
working-directory: web
77+
env:
78+
NEXT_PUBLIC_BASE_PATH: ${{ steps.pages.outputs.base_path }}
79+
run: node scripts/check-static.mjs
80+
- name: Upload static site
81+
uses: actions/upload-pages-artifact@v3
82+
with:
83+
path: web/out
84+
deploy:
85+
needs: build
86+
runs-on: ubuntu-latest
87+
environment:
88+
name: github-pages
89+
url: ${{ steps.deployment.outputs.page_url }}
90+
steps:
91+
- name: Deploy to GitHub Pages
92+
id: deployment
93+
uses: actions/deploy-pages@v4

‎README.md‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1-
# UFFeScience.github.io
1+
# UFF eScience Research Group
2+
3+
Public website: https://uffescience.github.io/
4+
5+
The live website is a static Next.js application in [`web/`](web/README.md). GitHub Actions exports and deploys it to GitHub Pages. Content and archived images are versioned in `web/data/`; there are no runtime Next.js APIs.
6+
7+
[Update and deployment workflow](https://github.com/UFFeScience/uffescience.github.io/actions/workflows/pages.yml) runs weekly on Monday at 09:00 Brasília and can be run manually. Apify credentials are stored only in Actions Secrets and ignored local environment files.
8+
9+
See [development and content documentation](web/README.md) for local preview, synchronization, storage and deployment details. Legacy Jekyll sources remain in the root as historical material; the Jekyll deployment workflow has been replaced.

‎web/.env.example‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
GITHUB_ORG=UFFeScience
2+
# Optional local GitHub token, never NEXT_PUBLIC. Actions uses GITHUB_TOKEN.
3+
GITHUB_TOKEN=
4+
# Repository Actions Secret and/or ignored local environment only.
5+
APIFY_TOKEN=
6+
# Empty for https://uffescience.github.io/; optional project-site prefix.
7+
NEXT_PUBLIC_BASE_PATH=

‎web/.gitignore‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
node_modules/
2+
.next/
3+
.env*
4+
!.env.example
5+
6+
data/raw/
7+
data/sync.lock
8+
data/*.tmp
9+
scripts/__pycache__/
10+
preview-*.jpg
11+
12+
data/sync*.log
13+
14+
preview-*.jpg
15+
16+
out/
17+
public/media/

‎web/AGENTS.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!-- BEGIN:nextjs-agent-rules -->
2+
3+
## This is NOT the Next.js you know
4+
5+
This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices.
6+
7+
This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean.
8+
9+
<!-- END:nextjs-agent-rules -->

‎web/README.md‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# UFF eScience — static Next.js site
2+
3+
JavaScript, Next.js App Router, `output: 'export'`. Public site: https://uffescience.github.io/ (organization site, no basePath). `NEXT_PUBLIC_BASE_PATH` supports a repository path when necessary; Actions derives it from configure-pages.
4+
5+
## Local preview
6+
7+
Node.js 22+, Python 3:
8+
9+
```sh
10+
npm ci
11+
npm run build
12+
node scripts/check-static.mjs
13+
python3 -m http.server 3007 --directory out
14+
```
15+
16+
`npm run dev -- --port 3007` is also available for editing. No deployed Node.js server, API routes, ISR or remote image optimization is required. Every publication slug and historical alias is generated during the build. HTML, CSS, JavaScript and archived images are published from `out/`.
17+
18+
## Stored content
19+
20+
- `data/publications.json`: full publication history, stable slugs, authors, dates, original LinkedIn links, deduplication aliases and collection metadata.
21+
- `data/projects.json`: repositories, real stars, contributor photos and recent public activity. The graph is a sample of public events, not complete commit history.
22+
- `data/people.json`: names and links scraped from Daniel’s public students and collaboration pages, including former students.
23+
- `data/media/`: versioned local images. Build copies them to `public/media/`, which is generated and ignored. Do not delete archived images while records reference them.
24+
25+
The site reads only stored files during the build. Visits do not call GitHub or Apify. Cards display stored content in chronological order with automatic horizontal pagination. Original post languages are preserved.
26+
27+
## Weekly update and deployment
28+
29+
`.github/workflows/pages.yml` is the only active schedule: Monday 12:00 UTC, equivalent to 09:00 Brasília. GitHub may delay scheduled jobs. Prior Apify and macOS schedules were disabled.
30+
31+
The workflow updates GitHub data, people and LinkedIn, commits changed content with GITHUB_TOKEN, builds and deploys Pages. Shared concurrency prevents overlapping runs. Bot commits do not trigger another workflow; `[skip ci]` adds a second safeguard. Pushes to main deploy without collecting LinkedIn. Concurrent human changes are rebased without force-pushing; conflicts stop publication instead of overwriting work.
32+
33+
Apify uses actor `buIWk2uOUzTmcLsuB` for UFFeScience’s company page and Daniel de Oliveira’s profile. The initial archived history is preserved. Weekly tasks collect the last month (up to 100 posts per source), update existing records and merge new ones. A source/week journal in the named Apify Key-value Store and a task-run lookup resume an existing run after interruption. Manual updates in the same week do not start another extraction. Failed sources retain the last valid files; an empty result never clears history. A failed run is not restarted in the same week. If a run is still active, rerun manually to import its result.
34+
35+
Open Actions → **Update content and deploy Next.js to Pages** → **Run workflow** on main. Keep `refresh_content` checked to update stored data, or uncheck it for a deployment only. For local updates: `npm run sync:weekly` with APIFY_TOKEN and optionally GITHUB_TOKEN in `.env.local` or the process environment. `--force` on the publication importer bypasses the local shortcut, but never the source/week extraction guard.
36+
37+
APIFY_TOKEN must be a repository Actions Secret and/or an ignored local environment variable. Never use NEXT_PUBLIC for credentials. `data/apify-config.json` contains only resource identifiers, not credentials. Set Pages source to GitHub Actions. Workflow contents write permission is required for content commits.

0 commit comments

Comments
 (0)