Skip to content

Commit

Permalink
Create action to automate Read More link generation (ScottLogic#83)
Browse files Browse the repository at this point in the history
* Automate read more (#9)

- Add action to auto-generate `read more` links
- Add necessary js files for auto generation
- Fix titles of broken posts

* Make workflow trigger manual and change AI model
  • Loading branch information
jhcoll authored Oct 25, 2023
1 parent 2b5ea46 commit 2809b6c
Show file tree
Hide file tree
Showing 9 changed files with 2,796 additions and 2,315 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/generate-related.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Generate Read More related

on:
workflow_dispatch:
branches:
- gh-pages

jobs:
generate-read-more:
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16.13.x
cache: npm
- run: npm install
- run: npm run compute-embeddings --OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}
- run: npm run generate-related
- name: Create Pull Request if Needed
uses: peter-evans/create-pull-request@v4
with:
title: Auto Generated Read More Links
branch: auto-generated-read-more-links
commit-message: Auto Generated Read More Links
base: gh-pages
body: |
This PR was automatically generated by a GitHub Action.
It contains the auto generated related links for all posts.
add-paths: |
_data/related.yml
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ Gemfile.lock
.vscode/

/container_gem_cache/
/dist/
/dist/
/scripts/generate-related/data/
File renamed without changes.
Loading

0 comments on commit 2809b6c

Please sign in to comment.