ci: only run the scripts that need envs to be added on main
This commit is contained in:
parent
7654485a6d
commit
a3e8d80c50
1 changed files with 16 additions and 8 deletions
|
@ -40,19 +40,24 @@ update:
|
||||||
variables:
|
variables:
|
||||||
- $UPDATE_FLAKE == "yes"
|
- $UPDATE_FLAKE == "yes"
|
||||||
|
|
||||||
# every commit on main will build and deploy
|
.scripts_base: &scripts_base
|
||||||
.build_template: &builder
|
# load nix environment
|
||||||
tags:
|
- . "$HOME/.nix-profile/etc/profile.d/nix.sh"
|
||||||
- nix
|
- git pull origin main
|
||||||
before_script:
|
|
||||||
|
.scripts_deploy: &scripts_deploy
|
||||||
# setup ssh key
|
# setup ssh key
|
||||||
- eval $(ssh-agent -s)
|
- eval $(ssh-agent -s)
|
||||||
- echo "$DEPLOY_KEY" | tr -d '\r' | ssh-add - > /dev/null
|
- echo "$DEPLOY_KEY" | tr -d '\r' | ssh-add - > /dev/null
|
||||||
- mkdir -p ~/.ssh
|
- mkdir -p ~/.ssh
|
||||||
- chmod 700 ~/.ssh
|
- chmod 700 ~/.ssh
|
||||||
# load nix environment
|
|
||||||
- . "$HOME/.nix-profile/etc/profile.d/nix.sh"
|
# every commit on main will build and deploy
|
||||||
- git pull origin main
|
.build_template: &builder
|
||||||
|
tags:
|
||||||
|
- nix
|
||||||
|
before_script:
|
||||||
|
- *scripts_base
|
||||||
only:
|
only:
|
||||||
changes:
|
changes:
|
||||||
- applications/**/*
|
- applications/**/*
|
||||||
|
@ -63,6 +68,9 @@ update:
|
||||||
|
|
||||||
# deploy items only run on main
|
# deploy items only run on main
|
||||||
.deploy_template: &deployment
|
.deploy_template: &deployment
|
||||||
|
before_script:
|
||||||
|
- *scripts_deploy
|
||||||
|
- *scripts_base
|
||||||
only:
|
only:
|
||||||
refs:
|
refs:
|
||||||
- main
|
- main
|
||||||
|
|
Loading…
Reference in a new issue