Skip to content

Commit 992f5e6

Browse files
committed
ci: migrate from CircleCI to GitHub Actions
CircleCI has been unable to check out the repository since its checkout key stopped working, so nothing has been deployed since 2023-10. Replace it with GitHub Actions and publish through the Pages deployment API instead of committing the build output to the master branch. - add .github/workflows/deploy.yml (build on every push/PR, deploy to Pages on source) - drop .circleci/config.yml and update.sh - drop rimraf and status-back, only used by the two files above - bump .node-version from 8.1.4 to 24, the current LTS - fix bulbofile.js for the ESM majors of gulp-nunjucks and gulp-markdown pulled in by #312 and #313, which broke the build - emit CNAME into build/ so the custom domain survives in the artifact
1 parent d5ec3a3 commit 992f5e6

7 files changed

Lines changed: 57 additions & 303 deletions

File tree

.circleci/config.yml

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

.github/workflows/deploy.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: build & deploy
2+
3+
on:
4+
push:
5+
branches: [source]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
# Let a running deploy finish rather than cancelling it half way.
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v7
22+
- uses: actions/setup-node@v7
23+
with:
24+
node-version-file: .node-version
25+
cache: npm
26+
- run: npm ci
27+
- run: npm run build
28+
# Uploaded on pull requests too, so the built site can be downloaded
29+
# from the run page for review.
30+
- uses: actions/upload-pages-artifact@v5
31+
with:
32+
path: build
33+
34+
deploy:
35+
needs: build
36+
if: github.event_name != 'pull_request'
37+
runs-on: ubuntu-latest
38+
permissions:
39+
pages: write
40+
id-token: write
41+
environment:
42+
name: github-pages
43+
url: ${{ steps.deployment.outputs.page_url }}
44+
steps:
45+
- id: deployment
46+
uses: actions/deploy-pages@v5

.node-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.1.4
1+
24

bulbofile.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ const asset = bulbo.asset
33

44
const path = require('path')
55
const frontMatter = require('gulp-front-matter')
6-
const nunjucks = require('gulp-nunjucks')
7-
const markdown = require('gulp-markdown')
6+
// gulp-nunjucks v6 / gulp-markdown v8 are ESM. require() of ESM is supported
7+
// on Node 22.12+ so we read the named / default exports off the namespace.
8+
const {nunjucksCompile} = require('gulp-nunjucks')
9+
const markdown = require('gulp-markdown').default
810
const wrapper = require('layout-wrapper')
911
const accumulate = require('vinyl-accumulate')
1012
const branch = require('branch-pipe')
@@ -35,7 +37,7 @@ const layout = defaultLayout => wrapper.nunjucks({
3537
asset('source/**/*.md', '!source/{events,jobs,news}/**/*')
3638
.watch('source/**/*.{md,njk}')
3739
.pipe(frontMatter({property: 'fm'}))
38-
.pipe(nunjucks.compile(data))
40+
.pipe(nunjucksCompile(data))
3941
.pipe(markdown())
4042
.pipe(layout('default'))
4143

@@ -128,3 +130,6 @@ asset('source/pdfs/**/*.pdf')
128130

129131
// Old site is available under http://nodejs.jp/old/
130132
asset('./old/*.*').base('./')
133+
134+
// The custom domain needs to be part of the published artifact
135+
asset('./CNAME').base('./')

0 commit comments

Comments
 (0)