summary refs log tree commit diff
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml34
1 files changed, 10 insertions, 24 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 8b97ff3..c680d0b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,30 +1,16 @@
 stages:
-  - build
-  - container
-
-build_and_test:
-  image: rust:alpine3.16
-  variables:
-    CARGO_HOME: ${CI_PROJECT_DIR}/.cargo
-  cache:
-      key: $CI_COMMIT_REF_SLUG
-      paths:
-      - target/
-      - .cargo/bin
-      - .cargo/registry/index
-      - .cargo/registry/cache
-
-  stage: build
-  before_script:
-    - apk add openssl openssl-dev musl-dev sqlite
-  script:
-    - cargo build
-    - cargo test
-container:
+  - nix
+nix:
   image: docker:stable
-  stage: container
+  stage: nix
   script:
-  - docker build . -t $CI_REGISTRY_IMAGE
+  - apk add curl git
+  - curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install linux --extra-conf "sandbox = false" --init none --no-confirm
+  - export PATH="${PATH}:/nix/var/nix/profiles/default/bin"
+  - nix flake check
+  - nix build .#dockerImage
+  - ./result | docker load
+  - docker tag vavbot $CI_REGISTRY_IMAGE
   - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD  $CI_REGISTRY
   - docker push $CI_REGISTRY_IMAGE