2021-10-18 11:02:54 +02:00
|
|
|
default:
|
|
|
|
image: node:latest
|
|
|
|
cache:
|
|
|
|
key: ${CI_COMMIT_REF_SLUG}
|
|
|
|
paths:
|
|
|
|
- node_modules/
|
|
|
|
- .npm/
|
|
|
|
|
|
|
|
stages: # List of stages for jobs, and their order of execution
|
|
|
|
- build
|
|
|
|
- deploy
|
|
|
|
|
|
|
|
build-job: # This job runs in the build stage, which runs first.
|
|
|
|
stage: build
|
|
|
|
script:
|
|
|
|
- npm install
|
|
|
|
- npm run build
|
2021-10-18 11:17:06 +02:00
|
|
|
artifacts:
|
|
|
|
expire_in: 1 week
|
|
|
|
paths:
|
|
|
|
- ./build
|
2021-10-18 11:02:54 +02:00
|
|
|
|
|
|
|
deploy-job: # This job runs in the deploy stage.
|
2021-10-18 11:17:06 +02:00
|
|
|
dependencies:
|
|
|
|
- build-job
|
2021-10-18 11:02:54 +02:00
|
|
|
stage: deploy # It only runs when *both* jobs in the test stage complete successfully.
|
|
|
|
script:
|
|
|
|
- apt-get update -qq && apt-get install -y -qq lftp
|
2021-10-18 11:27:22 +02:00
|
|
|
- lftp -c "open -u $USERNAME,$PASSWORD $HOST; mirror -Rnev ./build ./www --ignore-time --parallel=10 --exclude-glob .htaccess --exclude-glob .git* --exclude .git/"
|