mirror of https://gitlab.com/curben/blog
build: include site assets
This commit is contained in:
parent
c0ee49adca
commit
400cceb783
|
@ -5,6 +5,9 @@ on:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
|
env:
|
||||||
|
NODE_ENV: production
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if ! (set -o pipefail 2>/dev/null); then
|
||||||
|
# dash does not support pipefail
|
||||||
|
set -ex
|
||||||
|
else
|
||||||
|
set -ex -o pipefail
|
||||||
|
fi
|
||||||
|
|
||||||
|
export PATH="$PATH:./node_modules/.bin"
|
||||||
|
|
||||||
|
hexo generate
|
||||||
|
|
||||||
|
# deploy site assets
|
||||||
|
if [ "$NODE_ENV" = "production" ] && [ -d "public/" ]; then
|
||||||
|
git clone --depth 1 --branch site https://gitlab.com/curben/blog.git site
|
||||||
|
cp -r site/* "public/"
|
||||||
|
rm -f "public/README.md"
|
||||||
|
fi
|
|
@ -6,7 +6,7 @@
|
||||||
"version": "7.3.0"
|
"version": "7.3.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "hexo generate",
|
"build": "sh build.sh",
|
||||||
"snyk": "snyk auth $SNYK_TOKEN && snyk-protect && snyk test && snyk monitor",
|
"snyk": "snyk auth $SNYK_TOKEN && snyk-protect && snyk test && snyk monitor",
|
||||||
"renovate": "renovate --platform 'gitlab' --autodiscover false --onboarding false --update-lock-files false --labels 'renovate' --require-config='ignored' \"$CI_PROJECT_PATH\"",
|
"renovate": "renovate --platform 'gitlab' --autodiscover false --onboarding false --update-lock-files false --labels 'renovate' --require-config='ignored' \"$CI_PROJECT_PATH\"",
|
||||||
"deploy-cf-images": "npx wrangler deploy"
|
"deploy-cf-images": "npx wrangler deploy"
|
||||||
|
|
Loading…
Reference in New Issue