mirror of
https://github.com/DefectingCat/DefectingCat.github.io
synced 2025-07-15 16:51:37 +00:00
init gitlab ci
This commit is contained in:
30
.gitlab-ci.yml
Normal file
30
.gitlab-ci.yml
Normal file
@ -0,0 +1,30 @@
|
||||
stages:
|
||||
- build
|
||||
|
||||
image: 'node:latest'
|
||||
|
||||
before_script:
|
||||
- apt update -y
|
||||
- if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
|
||||
elif [ -f package-lock.json ]; then npm ci; \
|
||||
elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i --frozen-lockfile; \
|
||||
else echo "Lockfile not found." && exit 1; \
|
||||
fi
|
||||
- mkdir public
|
||||
|
||||
build:pretty-check:
|
||||
stage: build
|
||||
script:
|
||||
- pnpm i
|
||||
- pnpm pretty-check
|
||||
|
||||
build:local:
|
||||
stage: build
|
||||
script:
|
||||
- pnpm build-local
|
||||
- mkdir .next/standalone/public && cp -aR public/* .next/standalone/public
|
||||
- mkdir .next/standalone/public/_next && cp -aR .next/static/ .next/standalone/public/_next
|
||||
- 'mv .next/standalone/ public/'
|
||||
artifacts:
|
||||
paths:
|
||||
- public/standalone
|
Reference in New Issue
Block a user