Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support full CI/CD #156

Merged
merged 3 commits into from
Feb 17, 2025
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
55 changes: 55 additions & 0 deletions .github/workflows/deploy-book.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: deploy-book

# Runs on main branch changes or manual dispatch
on:
workflow_dispatch:
push:
branches:
- main

# This job installs dependencies, builds the book, and pushes it to `gh-pages`
jobs:
build:
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
steps:
- uses: actions/checkout@v3

# Install dependencies
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11

- name: Install dependencies
run: |
pip install -r requirements.txt

# Build the book
- name: Build the book
run: |
jupyter-book build --all .

# Upload the book's HTML as an artifact
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: "_build/html"

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
needs: build
steps:

# Deploy the book's HTML to GitHub Pages
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
17 changes: 10 additions & 7 deletions .github/workflows/link-check.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Check Links
name: Lint Markdown and check links
on:
push:
pull_request:
branches:
- main

Expand All @@ -15,11 +15,14 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
# I had an issue here where the node-version needed to be above '14'
node-version: '18'

- name: Install Dependencies
run: npm install -g markdown-link-check

- name: Check Links
run: markdown-link-check -q ./*.md -c mdlinkcheckconfig.json && markdown-link-check ./**/*.md -q -c mdlinkcheckconfig.json
run: |
npm install
npm install -g markdownlint-cli
npm install -g markdown-link-check
- name: Lint markdown
run: npm run lint
- name: Link check
run: npm run links-ci
9 changes: 8 additions & 1 deletion mdlinkcheckconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
{
"pattern": "https://doi.org/10.7910/DVN/TJCLKP"
},
{
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When running on CI, both of these links were failing so I added them to the ignore list. ospoplusplus serves just a blank page these days, I'm not sure if it has shut down or what.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has shut down.

"pattern": "https://ospoplusplus.com"
},
{
"pattern": "https://www.turing.ac.uk",
"reason": "403"
Expand All @@ -36,9 +39,13 @@
"pattern": "https://www.aps.org/",
"reason": "403"
},
{
"pattern": "https://www.aaas.org/",
"reason": "403"
},
{
"pattern": "https://openai.com/",
"reason": "403"
}
]
}
}
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@
"description": "An ecosystem map for academic OSS",
"scripts": {
"build": "jupyter-book build --all .",

"publish": "./build.sh",

"lint": "markdownlint . -i _build/ -i node_modules",
"lint-fix": "markdownlint --fix . -i _build/ -i node_modules",
"links": "markdown-link-check ./*.md -c mdlinkcheckconfig.json && markdown-link-check ./**/*.md -c mdlinkcheckconfig.json",
"links-ci": "markdown-link-check -q ./*.md -c mdlinkcheckconfig.json && markdown-link-check ./**/*.md -q -c mdlinkcheckconfig.json",

"run-all": "npm run lint && npm run links-ci",
"pretest": "npm run lint-fix"
},
Expand Down