deploy #343
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
name: deploy | |
on: | |
workflow_dispatch: | |
jobs: | |
bootstrap: | |
name: Bootstrap nix.conf options | |
runs-on: ubuntu-latest | |
outputs: | |
substituters: ${{ steps.getconf.outputs.substituters }} | |
trustedPublicKeys: ${{ steps.getconf.outputs.trustedPublicKeys }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: DeterminateSystems/nix-installer-action@main | |
- id: getconf | |
name: Get nix.conf configuration options | |
run: | | |
nix eval '.#extra.substituters' --apply 'builtins.toString' | tr -d '"' | awk '{print "substituters="$0}' | tee -a "$GITHUB_OUTPUT" | |
nix eval '.#extra.trusted-public-keys' --apply 'builtins.toString' | tr -d '"' | awk '{print "trustedPublicKeys="$0}' | tee -a "$GITHUB_OUTPUT" | |
deploy-fermi: | |
name: Deploy fermi NixOS server | |
runs-on: ubuntu-latest | |
needs: bootstrap | |
concurrency: | |
group: deploy-fermi | |
cancel-in-progress: true | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Free up runner disk space | |
run: ./.github/clean-space.bash | |
- uses: DeterminateSystems/nix-installer-action@main | |
with: | |
extra-conf: | | |
extra-substituters = ${{ needs.bootstrap.outputs.substituters }} | |
extra-trusted-public-keys = ${{ needs.bootstrap.outputs.trustedPublicKeys }} | |
- uses: DeterminateSystems/magic-nix-cache-action@main | |
- name: Install and configure attic | |
timeout-minutes: 60 | |
continue-on-error: true | |
run: ./.github/install-attic.bash | |
env: | |
ATTIC_SERVER: ${{ secrets.ATTIC_SERVER }} | |
ATTIC_CACHE: ${{ secrets.ATTIC_CACHE }} | |
ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }} | |
- name: Create ssh key from repository secrets | |
run: | | |
install -m 600 -D /dev/stdin ~/.ssh/id_ed25519 <<< "${{ secrets.PRIVATE_KEY }}" | |
- name: Deploy fermi | |
run: | | |
./.github/deploy-node.bash "fermi" "170.130.165.174" |