get rid of workflow, use pre-commit hook instead
This commit is contained in:
parent
874b187471
commit
5f3a8612ae
|
@ -1,36 +0,0 @@
|
||||||
name: CI
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ master ]
|
|
||||||
|
|
||||||
env:
|
|
||||||
WEBMENTION_TOKEN: ${{secrets.WEBMENTION_TOKEN}}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Get yarn cache directory path
|
|
||||||
id: yarn-cache-dir-path
|
|
||||||
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
|
|
||||||
|
|
||||||
- uses: actions/cache@v2
|
|
||||||
id: yarn-cache
|
|
||||||
with:
|
|
||||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
||||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-yarn-
|
|
||||||
|
|
||||||
- name: yarn jamstack build
|
|
||||||
run: |
|
|
||||||
yarn install
|
|
||||||
yarn run jamstack
|
|
||||||
|
|
||||||
- name: commit generated hugo stuff
|
|
||||||
uses: stefanzweifel/git-auto-commit-action@v4
|
|
||||||
with:
|
|
||||||
commit_message: jamstack update metadata
|
|
|
@ -1,4 +1,18 @@
|
||||||
[
|
[
|
||||||
|
{
|
||||||
|
"author": {
|
||||||
|
"name": "Jefklak",
|
||||||
|
"picture": "/pictures/jefklakscodex.com"
|
||||||
|
},
|
||||||
|
"name": "Looney Tunes Racing: Not So Daffy After All",
|
||||||
|
"content": "Not every Looney game is a Tune—that’s what I learned from playing this 2D Mario Kart arcade racing clone on the Game Boy Color. The fact that it nowaday costs less than €5 should probably raise an alarm bell—if collectors aren’t after it, ...",
|
||||||
|
"published": "2022-04-25T00:00:00+00:00",
|
||||||
|
"url": "https://jefklakscodex.com/games/gameboycolor/looney-tunes-racing/",
|
||||||
|
"type": "mention",
|
||||||
|
"source": "https://jefklakscodex.com/games/gameboycolor/looney-tunes-racing/",
|
||||||
|
"target": "https://jefklakscodex.com/games/gameboycolor",
|
||||||
|
"relativeTarget": "/games/gameboycolor"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Wouter Groeneveld",
|
"name": "Wouter Groeneveld",
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
|
||||||
|
const { webmention } = require('jam-my-stack');
|
||||||
|
|
||||||
|
if(!process.env.WEBMENTION_TOKEN) {
|
||||||
|
throw "No webmention token set!"
|
||||||
|
}
|
||||||
|
|
||||||
|
const wmconfig = {
|
||||||
|
endpoint: 'https://jam.brainbaking.com',
|
||||||
|
token: process.env.WEBMENTION_TOKEN
|
||||||
|
};
|
||||||
|
|
||||||
|
(async function() {
|
||||||
|
// 1. send webmentions
|
||||||
|
console.log("1. Sending webmentions...")
|
||||||
|
await webmention.send("jefklakscodex.com", wmconfig)
|
||||||
|
|
||||||
|
console.log("-- all done!")
|
||||||
|
})()
|
|
@ -0,0 +1,39 @@
|
||||||
|
|
||||||
|
const { howlongtobeat, webmention, youtube } = require('jam-my-stack');
|
||||||
|
const fsp = require('fs').promises;
|
||||||
|
|
||||||
|
if(!process.env.WEBMENTION_TOKEN) {
|
||||||
|
throw "No webmention token set!"
|
||||||
|
}
|
||||||
|
|
||||||
|
const wmconfig = {
|
||||||
|
endpoint: 'https://jam.brainbaking.com',
|
||||||
|
token: process.env.WEBMENTION_TOKEN
|
||||||
|
};
|
||||||
|
|
||||||
|
const rootdir = `${__dirname}/../`;
|
||||||
|
|
||||||
|
(async function() {
|
||||||
|
// 1. get how long to beat times
|
||||||
|
console.log("1. adding Howlongtobeat info...")
|
||||||
|
await howlongtobeat.howlong({
|
||||||
|
postDir: `${rootdir}/content`,
|
||||||
|
downloadDir: `${rootdir}/static/img/hltb`
|
||||||
|
})
|
||||||
|
|
||||||
|
// 2. get webmentions
|
||||||
|
console.log("2. Fetching webmentions...")
|
||||||
|
const mentions = await webmention.getWebmentions("jefklakscodex.com", wmconfig)
|
||||||
|
const json = JSON.stringify(mentions, null, 4)
|
||||||
|
await fsp.writeFile(`${rootdir}/data/webmentions.json`, json, 'utf-8')
|
||||||
|
|
||||||
|
// 3. generate youtube thumbnails.
|
||||||
|
console.log("4. Generating YouTube thumbnails...")
|
||||||
|
await youtube.thumbify({
|
||||||
|
postDir: `${rootdir}/content`,
|
||||||
|
downloadDir: `${rootdir}/static/img/yt`,
|
||||||
|
overlayImg: `${rootdir}/play.png`
|
||||||
|
})
|
||||||
|
|
||||||
|
console.log("-- all done!")
|
||||||
|
})()
|
|
@ -7,7 +7,8 @@
|
||||||
"doc": "docs"
|
"doc": "docs"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"jamstack": "node jamstack-init.js"
|
"precommit": "node hooks/precommit.js",
|
||||||
|
"postdeploy": "node hooks/postdeploy.js"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
Loading…
Reference in New Issue