/ .github / workflows / update-latest-symlink.bash
update-latest-symlink.bash
 1  #!/bin/bash
 2  
 3  set -o errexit
 4  set -o nounset
 5  set -o pipefail
 6  
 7  main () {
 8      if [[ $# -ne 1 ]]; then
 9          echo "$#: Wrong number of arguments"
10          return 1
11      fi
12  
13      local sha=$1
14      echo "$SSH_PRIVATE_KEY" >ssh-private-key
15      chmod go-rwx ssh-private-key
16      ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ssh-private-key github-actions@files.radicle.xyz ln -snf "/mnt/radicle/releases/${sha}" "/mnt/radicle/releases/latest"
17  }
18  
19  main "$@"