xyter/.gitlab-ci.yml

43 lines
879 B
YAML

stages:
- build
- docker
variables:
NODE_VERSION: "20"
cache:
key: "$CI_COMMIT_REF_SLUG"
paths:
- ~/.npm/
before_script:
- apk update && apk add git
- apk add nodejs npm
build:
stage: build
script:
- npm ci
- npm run build
- npx semantic-release
- find . -not -path "./node_modules/*" -type f -print0 | xargs -0 tar -czvf build-artifacts.tar.gz
artifacts:
paths:
- build-artifacts.tar.gz
docker:
stage: docker
image: docker:20.10.16
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""
services:
- docker:20.10.16-dind
before_script:
- docker info
script:
- apk add tar
- tar -xzvf build-artifacts.tar.gz
- echo $DOCKERHUB_TOKEN | docker login --username $DOCKERHUB_USERNAME --password-stdin
- docker build -t zyner/xyter:latest .
- docker push zyner/xyter:latest