Skip to content

fix invalid route json name #78

fix invalid route json name

fix invalid route json name #78

Workflow file for this run

name: NodeJS with Webpack
on:
push:
branches: ['master']
pull_request:
branches: ['master']
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: update submodules
run: |
wget https://raw.githubusercontent.com/dimaslanjaka/bin/master/bin/submodule-install
bash -e ./submodule-install
rm ./submodule-install
- name: set enviroment
id: set-env
shell: bash
run: |
echo "${HOME}/.local/bin" >> $GITHUB_PATH
echo "${GITHUB_WORKSPACE}/bin" >> $GITHUB_PATH
echo "${GITHUB_WORKSPACE}/node_modules/.bin" >> $GITHUB_PATH
echo "GITHUB_SHA_SHORT=$(echo $GITHUB_SHA | cut -c 1-6)" >> $GITHUB_ENV
echo "GITHUB_SHA_SHORT=$(echo $GITHUB_SHA | cut -c 1-6)" >> $GITHUB_OUTPUT
echo "GITHUB_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
echo "GITHUB_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
echo "GITHUB_COMMIT_URL=https://github.com/${{github.repository}}/commit/$(echo $GITHUB_SHA)" >> $GITHUB_ENV
echo "GITHUB_COMMIT_URL=https://github.com/${{github.repository}}/commit/$(echo $GITHUB_SHA)" >> $GITHUB_OUTPUT
echo "GITHUB_RUNNER_URL=https://github.com/${{github.repository}}/commit/${{github.sha}}/checks/${{github.run_id}}" >> $GITHUB_ENV
echo "GITHUB_RUNNER_URL=https://github.com/${{github.repository}}/commit/${{github.sha}}/checks/${{github.run_id}}" >> $GITHUB_OUTPUT
echo "CACHE_NPM=$(npm config get cache)" >> $GITHUB_ENV
echo "CACHE_NPM=$(npm config get cache)" >> $GITHUB_OUTPUT
YARN_CURRENT=$(yarn -v)
YARN_BERRY=3.2.1
if [[ "ok" == "$(echo | awk "(${YARN_CURRENT} > ${YARN_BERRY}) { print \"ok\"; }")" ]]; then
echo "CACHE_YARN=$(yarn config get cacheFolder)" >> $GITHUB_ENV
echo "CACHE_YARN=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
else
echo "CACHE_YARN=$(yarn cache dir)" >> $GITHUB_ENV
echo "CACHE_YARN=$(yarn cache dir)" >> $GITHUB_OUTPUT
fi
echo "architecture=$(getconf LONG_BIT)" >> $GITHUB_ENV
if [ -f "package-lock.json" ]; then
echo "PACKAGE-MANAGER=npm" >> $GITHUB_OUTPUT
echo "PACKAGE-MANAGER=npm" >> $GITHUB_ENV
else
echo "PACKAGE-MANAGER=yarn" >> $GITHUB_OUTPUT
echo "PACKAGE-MANAGER=yarn" >> $GITHUB_ENV
fi
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*) machine=linux;;
Darwin*) machine=mac;;
CYGWIN*) machine=cygwin;;
MINGW*) machine=mingw;;
*) machine="unknown:${unameOut}"
esac
echo "machine=$machine" >> $GITHUB_OUTPUT
echo "machine=$machine" >> $GITHUB_ENV
- name: enable corepack
run: corepack enable
- uses: actions/cache@v3
id: cache
with:
path: |
./.yarn
./yarn.lock
**/node_modules
./tmp
./test/tmp
./dist
./routes.json
./_config.json
./.cache
${{ steps.set-env.outputs.CACHE_YARN }}
${{ steps.set-env.outputs.CACHE_NPM }}
key: test-${{ runner.os }}-${{ matrix.node-version }}
- name: install
run: |
touch yarn.lock
echo {} > _config.json
echo [] > routes.json
mkdir -p tmp
mkdir -p tmp/meta
mkdir -p tmp/static
mkdir -p src/posts
yarn install
- name: populate sample source posts and routes
run: |
node -r ts-node/register test/test-scripts/index.ts
# - name: copy source posts
# run: npx sbg post copy
# - name: mapping source posts
# run: gulp map
# - name: generate route
# run: gulp route
- name: build
run: yarn build