diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 925b731..4d5d56e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,7 +2,8 @@ image: nixpkgs/nix-flakes workflow: rules: - - if: $CI_COMMIT_BRANCH + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + - if: $CI_MERGE_REQUEST_ID variables: STACK_ROOT: "${CI_PROJECT_DIR}/.stack-root" @@ -13,6 +14,10 @@ cache: - .stack-root - _cache +stages: + - review + - deploy + pages: stage: deploy script: &build-script @@ -21,13 +26,30 @@ pages: paths: - public rules: - - if: $CI_COMMIT_BRANCH == "main" + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH -test: - stage: test +review:start: + stage: review script: *build-script artifacts: paths: - public rules: - - if: $CI_COMMIT_BRANCH != "main" + - if: $CI_MERGE_REQUEST_ID + environment: + name: preview/${CI_PROJECT_NAME}/${CI_COMMIT_REF_NAME} + url: https://${CI_PROJECT_NAMESPACE}.pages.uniworx.de/-/${CI_PROJECT_NAME}/-/jobs/${CI_JOB_ID}/artifacts/public/index.html + auto_stop_in: 2 weeks + on_stop: review:stop + +review:stop: + stage: review + rules: + - if: $CI_MERGE_REQUEST_ID + when: manual + allow_failure: true + environment: + name: preview/${CI_PROJECT_NAME}/${CI_COMMIT_REF_NAME} + action: stop + script: + - echo 'Terminating review app' diff --git a/frontend/node_modules.gup b/frontend/node_modules.gup index 5ce3bf5..6c123f3 100644 --- a/frontend/node_modules.gup +++ b/frontend/node_modules.gup @@ -1,5 +1,5 @@ #!/usr/bin/env sh gup -u package.json yarn.lock -yarn install +yarn install --frozen-lockfile --check-files --non-interactive touch node_modules