-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
infra: Automatically deploy makemake (#241)
- Loading branch information
1 parent
8d69f3a
commit 816ad2a
Showing
3 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: makemake | ||
|
||
on: { push: { branches: [ 'main' ] } } | ||
|
||
jobs: | ||
deploy: | ||
environment: makemake | ||
runs-on: ubuntu-latest | ||
env: | ||
SSH_KEY: ${{ secrets.SSH_KEY }} | ||
FLAKE_REF_SHORT: github:${{ github.repository }}/${{ github.sha }}#makemake | ||
FLAKE_REF_TOPLEVEL: github:${{ github.repository }}/${{ github.sha }}#nixosConfigurations.makemake.config.system.build.toplevel | ||
SSH_HOST: root@makemake.ngi.nixos.org | ||
steps: | ||
- uses: 'DeterminateSystems/nix-installer-action@main' | ||
name: 'Install Nix' | ||
with: { extra-conf: 'experimental-features = no-url-literals' } | ||
|
||
- name: Prepare SSH | ||
run: | | ||
mkdir -p ~/.ssh | ||
printenv SSH_KEY > ~/.ssh/id_ed25519 | ||
chmod 600 ~/.ssh/id_ed25519 | ||
echo "makemake.ngi.nixos.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID4ejRuAQPx6AbuS1u+Q7UUi1TIwkY2S//kjgpBxYNfU" \ | ||
> ~/.ssh/known_hosts | ||
- name: Build | ||
run: | | ||
nix run nixpkgs#nixos-rebuild -- build \ | ||
--flake "$FLAKE_REF_SHORT" \ | ||
--build-host "$SSH_HOST" \ | ||
--target-host "$SSH_HOST" | ||
- name: Difference | ||
run: | | ||
ssh "$SSH_HOST" -- \ | ||
"nix build \"$FLAKE_REF_TOPLEVEL\" && nix run nixpkgs#nvd -- diff /run/current-system result" | ||
- name: Deploy | ||
run: | | ||
nix run nixpkgs#nixos-rebuild -- switch \ | ||
--flake "$FLAKE_REF_SHORT" \ | ||
--build-host "$SSH_HOST" \ | ||
--target-host "$SSH_HOST" |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
/infra/ @Erethon @Ericson2314 @fricklerhandwerk @Janik-Haag @lorenzleutgeb | ||
/infra/ @ngi-nix/infra | ||
/.github/workflows/makemake.yaml @ngi-nix/infra |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters