Skip to content

Commit

Permalink
fix website build (#1807)
Browse files Browse the repository at this point in the history
* enable website build

* use import with node-fetch

* log npm version

* fix fetch import

* debugging contributors

* disable esling for scripts, only import vuepress in CI

* update build.yml
  • Loading branch information
epoberezkin committed Nov 3, 2021
1 parent 29caf13 commit fefd2e3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ jobs:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: git submodule update --init
# - name: update website
# if: ${{ github.event_name == 'push' && matrix.node-version == '14.x' }}
# run: ./scripts/publish-site
# env:
# GH_TOKEN_PUBLIC: ${{ secrets.GH_TOKEN_PUBLIC }}
# GIT_USER_EMAIL: ${{ secrets.GIT_USER_EMAIL }}
# GIT_USER_NAME: ${{ secrets.GIT_USER_NAME }}
- name: update website
if: ${{ github.event_name == 'push' && matrix.node-version == '14.x' }}
run: ./scripts/publish-site
env:
GH_TOKEN_PUBLIC: ${{ secrets.GH_TOKEN_PUBLIC }}
GIT_USER_EMAIL: ${{ secrets.GIT_USER_EMAIL }}
GIT_USER_NAME: ${{ secrets.GIT_USER_NAME }}
- run: npm run build
- run: npm run test-ci
- name: coveralls
Expand Down
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
".runkit_example.js"
],
"scripts": {
"eslint": "eslint \"lib/**/*.ts\" \"spec/**/*.*s\" scripts --ignore-pattern spec/JSON-Schema-Test-Suite",
"eslint": "eslint \"lib/**/*.ts\" \"spec/**/*.*s\" --ignore-pattern spec/JSON-Schema-Test-Suite",
"prettier:write": "prettier --write \"./**/*.{json,yaml,js,ts}\"",
"prettier:check": "prettier --list-different \"./**/*.{json,yaml,js,ts}\"",
"test-spec": "cross-env TS_NODE_PROJECT=spec/tsconfig.json mocha -r ts-node/register \"spec/**/*.spec.{ts,js}\" -R dot -g \\(.recursiveRef.with.no..recursiveAnchor\\|.dynamicRef.with.no..dynamicAnchor\\).in.the.initial.target.schema.resource -i",
Expand Down Expand Up @@ -74,7 +74,6 @@
"@types/require-from-string": "^1.2.0",
"@typescript-eslint/eslint-plugin": "^3.8.0",
"@typescript-eslint/parser": "^3.8.0",
"@vuepress/shared-utils": "^1.8.2",
"ajv-formats": "^2.0.0",
"chai": "^4.0.1",
"cross-env": "^7.0.2",
Expand All @@ -100,8 +99,7 @@
"rollup-plugin-terser": "^7.0.2",
"ts-node": "^10.0.0",
"tsify": "^5.0.2",
"typescript": "^4.2.0",
"vuepress": "^1.8.2"
"typescript": "^4.2.0"
},
"collective": {
"type": "opencollective",
Expand Down
7 changes: 4 additions & 3 deletions scripts/get-contributors.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// https://github.com/sveltejs/svelte/blob/ce3a5791258ec6ecf8c1ea022cb871afe805a45c/site/scripts/get-contributors.js

const fs = require("fs")
const fetch = require("node-fetch")
const Jimp = require("jimp")

process.chdir(__dirname)
Expand All @@ -12,7 +11,11 @@ const {GH_TOKEN_PUBLIC} = process.env

const SIZE = 64

main()

async function main() {
const fetch = (await import("node-fetch")).default

const contributors = []
let page = 1

Expand Down Expand Up @@ -53,5 +56,3 @@ async function main() {
`module.exports = ${str}`
)
}

main()
2 changes: 2 additions & 0 deletions scripts/publish-site
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ set -ex
echo "About to publish $GITHUB_REF to gh-pages..."
rm -rf ../gh-pages

npm install vuepress@1
npm install @vuepress/shared-utils@1
npm run docs:build

git config --global user.name "$GIT_USER_NAME"
Expand Down

0 comments on commit fefd2e3

Please sign in to comment.