xyter/.gitlab-ci.yml

46 lines
No EOL
1 KiB
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://dind: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
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -t $CI_REGISTRY/zyner/xyter/bot:latest .
- docker push $CI_REGISTRY/zyner/xyter/bot:latest