Files
George Cushen 1cf3eacddb ci: update node/actions due to GH node v20 deprecation
Still on node20 - blocked on upstream releases:

peaceiris/actions-hugo@v3 - the maintainer merged a node24 upgrade to main but hasn't cut a new release tag yet; nothing to do until v3.1.0 drops
HugoBlox/gh-action-updater@v2 - needs update
2026-05-02 22:09:13 +01:00

55 lines
1.9 KiB
YAML

# Hugo Blox GitHub Action to import Jupyter Notebooks as blog posts
name: Import Jupyter Notebooks as Blog Posts
# Require permission to create a PR
permissions:
contents: write
pull-requests: write
# Run workflow when a `.bib` file is added or updated in the `data/` folder
on:
push:
branches: ['main']
paths: ['notebooks/*.ipynb']
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
hugoblox:
if: github.repository_owner != 'HugoBlox'
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v6
- name: Set up Python 3.12
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install academic==0.11.2
- name: Run Academic Converter Tool
run: academic import 'notebooks/*.ipynb' content/blog/ --verbose
- name: Create Pull Request
# Set ID for `Check outputs` stage
id: cpr
uses: peter-evans/create-pull-request@v8
with:
commit-message: 'content: import blog posts from `notebooks/` folder'
title: HugoBlox Kit - Import latest blog posts
body: |
Convert Jupyter Notebooks in the `notebooks/` folder into blog posts in the `content/blog/` folder.
将`notebooks/`文件夹中的Jupyter笔记本转换为`content/blog/`文件夹中的博客帖子。
[View Documentation](https://github.com/GetRD/academic-file-converter)
base: main
labels: automated-pr, content
branch: hugoblox-import-posts
delete-branch: true
- name: Check outputs
if: ${{ steps.cpr.outputs.pull-request-number }}
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"