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
58 changes: 43 additions & 15 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,59 @@
name: Deploy Website

# Builds the Hugo site and publishes it with GitHub Pages' official deployment
# action. Pull requests only verify that the site builds.
#
# One-time repo setting: Settings > Pages > Build and deployment > Source must
# be "GitHub Actions" (not "Deploy from a branch").

on:
push:
branches:
- hugo
pull_request:
branches:
- hugo
workflow_dispatch:

permissions:
contents: read

# Never cancel a deployment that is already running; superseded pull request
# builds are cancelled.
concurrency:
group: ${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.number) || 'pages' }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
deploy:
runs-on: macos-latest
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true # Fetch Hugo themes
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- uses: actions/checkout@v7

- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.68.3'
# extended: true
hugo-version: '0.135.0'

- name: Build
run: hugo --minify
run: hugo --minify --gc

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
- name: Upload site
uses: actions/upload-pages-artifact@v5
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
publish_branch: master
path: ./public

deploy:
if: github.event_name != 'pull_request'
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,7 @@ _site/
.jekyll-cache/
.jekyll-metadata

.hugo_build.lock
# Hugo
public/
resources/
.hugo_build.lock
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# interimm.org

Source for [interimm.org](https://interimm.org), a bilingual (中文 / English) [Hugo](https://gohugo.io) site.

## Develop

Install Hugo (tested with 0.135.0) and run:

```sh
hugo server
```

The site is self-contained: layouts, styles and data live in this repository (there is no theme submodule).

## Where things live

| Path | What |
| --- | --- |
| `hugo.yaml` | Site config, including the navigation menu for each language |
| `content/{cn,en}/` | Pages. `cn` is the default language and is served from `/` |
| `data/*.yml` | Content for the home page, archives, activities, institutes and footer, keyed by language |
| `i18n/` | Small UI strings (menu label, 404 text, ...) |
| `layouts/` | Templates |
| `assets/` | CSS and JS, minified and fingerprinted by Hugo at build time |
| `static/` | Files served as-is (images, video, favicons) |

## Deploy

Pushing to the `hugo` branch builds the site in GitHub Actions and publishes it with GitHub Pages' official
deployment action. Pull requests against `hugo` only check that the site builds, and the workflow can also be
run by hand from the Actions tab.

This needs the repository's Pages source set to **GitHub Actions** (Settings > Pages > Build and deployment).

Analytics is off: the old Universal Analytics property no longer collects data. To enable Google Analytics 4,
uncomment the `services.googleAnalytics.id` block in `hugo.yaml`.
Loading
Loading