fileserver/.gitlab-ci.yml
2022-08-23 11:30:27 +02:00

81 lines
1.3 KiB
YAML

image: node:latest
stages:
- test
- build
- package
cache:
- key:
files:
- yarn.lock
paths:
- node_modules
- key:
files:
- frontend/yarn.lock
paths:
- frontend/node_modules
before_script:
- yarn install
- cd frontend
- yarn install
- cd ..
test_backend:
stage: test
script:
- yarn lint
test_frontend:
stage: test
script:
- cd frontend
- yarn lint
build_backend:
stage: build
needs:
- job: test_backend
artifacts: false
script:
- yarn webpack
artifacts:
paths:
- dist/
expire_in: 1h
build_frontend:
stage: build
needs:
- job: test_frontend
artifacts: false
script:
- cd frontend
- yarn build
artifacts:
paths:
- frontend/dist/
expire_in: 1h
package_server:
stage: package
cache: []
needs:
- job: build_backend
artifacts: true
- job: build_frontend
artifacts: true
script:
- TMP=$(mktemp -d)
- mv dist/* "$TMP"
- mkdir "$TMP/frontend"
- mv frontend/dist/* "$TMP/frontend"
- rm -r *
- rm -r .* || true
- mv "$TMP/"* .
artifacts:
paths:
- .