Deploy to anglerfish from new-tv-pc by @BNH440 #827
Workflow file for this run
This file contains hidden or 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: Manually Deploy to Host | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| hosts: | |
| description: 'Comma separated hostnames or tags (ex: @desktop) to deploy' | |
| required: true | |
| type: string | |
| run-name: Deploy to ${{ inputs.hosts }} from ${{ github.ref_name }} by @${{ github.actor }} | |
| jobs: | |
| deploy-on-hosts: | |
| runs-on: ci-ocf-nix-deploy | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup SSH | |
| run: | | |
| echo '${{ secrets.COLMENA_APPLY_SSH_KEY }}' > ${{ github.workspace }}/id_ed25519 | |
| chmod 400 ${{ github.workspace }}/id_ed25519 | |
| for keyfile in ${{ github.workspace }}/secrets/host-keys/*.pub; do | |
| hostname=$(basename "$keyfile" .pub) | |
| fqdn="$hostname.ocf.berkeley.edu" | |
| pubkey=$(cat "$keyfile") | |
| echo "$fqdn $pubkey" | |
| done > ${{ github.workspace }}/known_hosts | |
| echo " | |
| Identityfile $GITHUB_WORKSPACE/id_ed25519 | |
| UserKnownHostsFile $GITHUB_WORKSPACE/known_hosts | |
| StrictHostKeyChecking yes | |
| UpdateHostKeys no | |
| " >> ${{ github.workspace }}/ssh_config | |
| - name: Deploy with Colmena | |
| env: | |
| SSH_CONFIG_FILE: ${{ github.workspace }}/ssh_config | |
| run: nix develop .#deploy -c colmena apply --on ${{ inputs.hosts }} |