Kieran's opinionated (and probably slightly dumb) nix config

feat: allow build step

dunkirk.sh aba5b230 20751b49

verified
+14 -5
+14 -5
.github/workflows/deploy-service.yml
··· 24 required: false 25 type: string 26 description: "SQLite DB path for pre-deploy snapshot (e.g. /var/lib/cachet/data/cachet.db)" 27 secrets: 28 TS_OAUTH_CLIENT_ID: 29 required: true 30 TS_OAUTH_SECRET: 31 required: true 32 - 33 - permissions: 34 - deployments: write 35 36 jobs: 37 deploy: ··· 107 fi 108 109 echo "::group::install & restart" 110 - ssh ${{ inputs.service }}@${{ inputs.host }} << 'INSTALL' 111 set -e 112 - cd ~/app 113 bun install --frozen-lockfile 114 sudo /run/current-system/sw/bin/systemctl restart ${{ inputs.service }}.service 115 INSTALL 116 echo "::endgroup::" ··· 217 fi 218 219 git reset --hard "$PREV" --quiet 220 bun install --frozen-lockfile 2>&1 | tail -1 221 sudo /run/current-system/sw/bin/systemctl restart ${{ inputs.service }}.service 222 223 echo -e "${G}:: rolled back to ${SHORT}${R}"
··· 24 required: false 25 type: string 26 description: "SQLite DB path for pre-deploy snapshot (e.g. /var/lib/cachet/data/cachet.db)" 27 + work_dir: 28 + required: false 29 + type: string 30 + default: "." 31 + description: "Subdirectory to run install/build from (relative to ~/app)" 32 + build_command: 33 + required: false 34 + type: string 35 + description: "Build command to run after install (e.g. 'bun run build')" 36 secrets: 37 TS_OAUTH_CLIENT_ID: 38 required: true 39 TS_OAUTH_SECRET: 40 required: true 41 42 jobs: 43 deploy: ··· 113 fi 114 115 echo "::group::install & restart" 116 + ssh ${{ inputs.service }}@${{ inputs.host }} << INSTALL 117 set -e 118 + cd ~/app/${{ inputs.work_dir }} 119 bun install --frozen-lockfile 120 + ${{ inputs.build_command }} 121 sudo /run/current-system/sw/bin/systemctl restart ${{ inputs.service }}.service 122 INSTALL 123 echo "::endgroup::" ··· 224 fi 225 226 git reset --hard "$PREV" --quiet 227 + cd ~/app/${{ inputs.work_dir }} 228 bun install --frozen-lockfile 2>&1 | tail -1 229 + ${{ inputs.build_command }} 230 sudo /run/current-system/sw/bin/systemctl restart ${{ inputs.service }}.service 231 232 echo -e "${G}:: rolled back to ${SHORT}${R}"