Skip to content

Commit

Permalink
Update GitHub actions to all be Node20+ (#271)
Browse files Browse the repository at this point in the history
  • Loading branch information
wilwade authored Feb 29, 2024
1 parent f95e126 commit e632271
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 23 deletions.
31 changes: 16 additions & 15 deletions .github/workflows/common/set-up-mdbook/action.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
name: "Install mdBook with Plugins"
description: 'Shared action steps to install mdBook with required plugins'
description: "Shared action steps to install mdBook with required plugins"
inputs:
token:
description: "Pass through for secrets.GITHUB_TOKEN"
required: true
runs:
using: "composite"
steps:
- name: Setup mdBook 📚
uses: peaceiris/actions-mdbook@adeb05db28a0c0004681db83893d56c0388ea9ea
uses: jontze/action-mdbook@0765bef0c7c5792f93bf3ed3d487a0ca32c9da33
with:
mdbook-version: 'latest'
token: ${{ inputs.token }}
mdbook-version: "~0.4.37" # Use a semver compatible string
# Optional Plugins have to be enabled
use-linkcheck: true
linkcheck-version: "~0.7.7"

- name: Install mdbook-linkcheck plugin
- name: Show mdbook version
shell: bash
run: |
curl -s https://api.github.com/repos/Michael-F-Bryan/mdbook-linkcheck/releases/latest \
| grep browser_download_url \
| grep $(rustc -Vv | grep host | cut -d' ' -f2) \
| cut -d : -f 2,3 \
| tr -d \" \
| wget -qi - -O mdbook-linkcheck.zip
unzip mdbook-linkcheck.zip -d mdbook-linkcheck
chmod +x mdbook-linkcheck/mdbook-linkcheck
echo "$PWD/mdbook-linkcheck" >> $GITHUB_PATH
run: mdbook --version
- name: Show linkchecker version
shell: bash
run: mdbook-linkcheck --version
8 changes: 5 additions & 3 deletions .github/workflows/deploy-gh-pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy to GitHub Pages
on:
push:
tags:
- '[0-9][0-9][0-9][0-9].[0-9][0-9].[0-9][0-9][0-9]'
- "[0-9][0-9][0-9][0-9].[0-9][0-9].[0-9][0-9][0-9]"

permissions:
contents: read
Expand All @@ -19,6 +19,8 @@ jobs:

- name: Set up mdBook 📚
uses: ./.github/workflows/common/set-up-mdbook
with:
token: ${{secrets.GITHUB_TOKEN}}

- name: Setup Pages
id: pages
Expand All @@ -28,7 +30,7 @@ jobs:
run: mdbook build

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
uses: actions/upload-pages-artifact@v3
with:
path: ./book/html

Expand All @@ -42,4 +44,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v3
uses: actions/deploy-pages@v4
12 changes: 7 additions & 5 deletions .github/workflows/verify-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ name: Verify PR

on:
pull_request:
branches:
branches:
- main

jobs:
verify:
runs-on: ubuntu-20.04
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Use Node.js 🐰
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20

- name: Install Node Modules 💾
run: npm ci
Expand All @@ -25,6 +25,8 @@ jobs:

- name: Set up mdBook 📚
uses: ./.github/workflows/common/set-up-mdbook

with:
token: ${{secrets.GITHUB_TOKEN}}

- name: Build mdBook 📚
run: mdbook build

0 comments on commit e632271

Please sign in to comment.