From ca1e6148d0d62674cbfef8a2ab521c6883d0c536 Mon Sep 17 00:00:00 2001 From: Vermium Sifell Date: Thu, 29 Jun 2023 18:56:56 +0000 Subject: [PATCH] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..2816f4e --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,37 @@ +stages: + - build + - docker + +variables: + NODE_VERSION: "20" + +cache: + key: "$CI_COMMIT_REF_SLUG" + paths: + - ~/.npm/ + +before_script: + - apt-get update -qq && apt-get install -y -qq curl + - curl -sL https://deb.nodesource.com/setup_$NODE_VERSION.x | bash - + - apt-get install -y -qq nodejs + +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 + script: + - apt-get install -y -qq tar + - tar -xzvf build-artifacts.tar.gz + - docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_TOKEN + - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + - docker buildx create --use --name mybuilder + - docker buildx build --push --platform linux/amd64 --tag zyner/xyter:latest --build-arg TAGS="$(cat tags.txt | tr '\n' ',')"