mirror of
https://git.adityakumar.xyz/nix-matlab.git
synced 2024-11-09 16:19:45 +00:00
First trial in a nix flake update CI
This commit is contained in:
parent
4a49cf8884
commit
abad30d9cf
1 changed files with 22 additions and 0 deletions
22
.gitlab-ci.yml
Normal file
22
.gitlab-ci.yml
Normal file
|
@ -0,0 +1,22 @@
|
|||
default:
|
||||
image: nixpkgs/nix-flakes
|
||||
|
||||
update-nix-flakes:
|
||||
# Based on: https://forum.gitlab.com/t/git-push-from-inside-a-gitlab-runner/30554/5
|
||||
before_script:
|
||||
- eval `ssh-agent -s`
|
||||
- mkdir --mode=700 -p ~/.ssh
|
||||
- ssh-keyscan "$CI_SERVER_HOST" >> ~/.ssh/known_hosts
|
||||
- echo "$SSH_PUBLIC_KEY" >> ~/.ssh/id_rsa.pub
|
||||
- echo "${SSH_PRIVATE_KEY}" | ssh-add -
|
||||
script:
|
||||
- git config --global user.email "nix-matlab-CI@doronbehar.com"
|
||||
- git config --global user.name "Nix Matlab CI"
|
||||
- git remote add ci ssh://git@$CI_SERVER_HOST/$CI_PROJECT_PATH.git
|
||||
- type nix
|
||||
- nix --version
|
||||
- nix flake update
|
||||
- git add .
|
||||
- git status
|
||||
- git commit --message "[skip ci] Automatic nix flake update by CI" || echo "No changes, nothing to commit!"
|
||||
- git push ci HEAD:$CI_COMMIT_REF_NAME # Pushes to the same branch as the trigger
|
Loading…
Reference in a new issue