get rid of workflow, use pre-commit hook instead
This commit is contained in:
parent
29502fb247
commit
0f9b3999b3
|
@ -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
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
|
||||||
|
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...")
|
||||||
|
const since = await webmention.send("redzuurdesem.be", wmconfig)
|
||||||
|
console.log(` -- done`)
|
||||||
|
|
||||||
|
console.log("-- all done!")
|
||||||
|
})()
|
|
@ -11,32 +11,29 @@ const wmconfig = {
|
||||||
token: process.env.WEBMENTION_TOKEN
|
token: process.env.WEBMENTION_TOKEN
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const rootdir = `${__dirname}/../`;
|
||||||
|
|
||||||
(async function() {
|
(async function() {
|
||||||
// 1. build Lunr index
|
// 1. build Lunr index
|
||||||
console.log("1. Building lunr search index...")
|
console.log("1. Building lunr search index...")
|
||||||
const index = await lunr.buildIndex([
|
const index = await lunr.buildIndex([
|
||||||
`${__dirname}/content/post`,
|
`${rootdir}/content/post`,
|
||||||
`${__dirname}/content/kort`,
|
`${rootdir}/content/kort`,
|
||||||
`${__dirname}/content/leren`])
|
`${rootdir}/content/leren`])
|
||||||
await fsp.writeFile(`${__dirname}/static/js/redzuurdesem-post.json`, JSON.stringify(index), 'utf-8')
|
await fsp.writeFile(`${rootdir}/static/js/redzuurdesem-post.json`, JSON.stringify(index), 'utf-8')
|
||||||
|
|
||||||
// 2. get webmentions
|
// 2. get webmentions
|
||||||
console.log("2. Fetching webmentions...")
|
console.log("2. Fetching webmentions...")
|
||||||
const mentions = await webmention.getWebmentions("redzuurdesem.be", wmconfig)
|
const mentions = await webmention.getWebmentions("redzuurdesem.be", wmconfig)
|
||||||
const json = JSON.stringify(mentions, null, 4)
|
const json = JSON.stringify(mentions, null, 4)
|
||||||
await fsp.writeFile(`${__dirname}/data/webmentions.json`, json, 'utf-8')
|
await fsp.writeFile(`${rootdir}/data/webmentions.json`, json, 'utf-8')
|
||||||
|
|
||||||
// 3. send webmentions
|
// 3. build youtube thumbnails
|
||||||
console.log("3. Sending webmentions...")
|
|
||||||
const since = await webmention.send("redzuurdesem.be", wmconfig)
|
|
||||||
console.log(` -- done`)
|
|
||||||
|
|
||||||
// 4. build youtube thumbnails
|
|
||||||
console.log("4. building youtube thumbnails...")
|
console.log("4. building youtube thumbnails...")
|
||||||
await youtube.thumbify({
|
await youtube.thumbify({
|
||||||
postDir: `${__dirname}/content`,
|
postDir: `${rootdir}/content`,
|
||||||
downloadDir: `${__dirname}/static/images/yt`,
|
downloadDir: `${rootdir}/static/images/yt`,
|
||||||
overlayImg: `${__dirname}/play.png`
|
overlayImg: `${rootdir}/play.png`
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,8 @@
|
||||||
"@babel/preset-env": "^7.9.6"
|
"@babel/preset-env": "^7.9.6"
|
||||||
},
|
},
|
||||||
"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