set rules for gitlab ci jobs

This should give us access to more CI variables. This also replaces our
usage of `only`, which is apparently deprecated.
This commit is contained in:
Charles Hall 2024-11-01 11:28:10 -07:00
parent 2f8e0e3e52
commit f0e41ade59
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF

View file

@ -38,6 +38,9 @@ before_script:
ci:
stage: ci
image: nixos/nix:2.18.2
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
script:
- ./bin/nix-build-and-cache ci
@ -50,17 +53,20 @@ ci:
artifacts:
stage: artifacts
image: nixos/nix:2.18.2
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
script:
- ./bin/nix-build-and-cache packages
pages:
stage: deploy
image: nixos/nix:2.18.2
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
script:
- nix build .#website-root
- cp --recursive --dereference result public
artifacts:
paths:
- public
only:
- main