Deploy #17
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: Deploy | |
| on: | |
| workflow_dispatch: | |
| concurrency: | |
| group: deploy | |
| cancel-in-progress: false | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Free disk space | |
| uses: jlumbroso/free-disk-space@v1.3.1 | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - uses: DeterminateSystems/nix-installer-action@main | |
| with: | |
| extra-conf: | | |
| accept-flake-config = true | |
| fallback = true | |
| sandbox = false | |
| - uses: DeterminateSystems/magic-nix-cache-action@main | |
| - name: Setup SSH | |
| run: | | |
| mkdir -p ~/.ssh | |
| echo "${{ secrets.SSH_KEY }}" > ~/.ssh/id_ed25519 | |
| chmod 600 ~/.ssh/id_ed25519 | |
| - name: Resolve host IP | |
| run: | | |
| host_ip=$(nix run .#resolveIp) | |
| echo "::add-mask::$host_ip" | |
| echo "HOST_IP=$host_ip" >> "$GITHUB_ENV" | |
| - name: Trust host key | |
| run: | | |
| host_key=$(nix eval --raw --file keys.nix keys.host) | |
| echo "$HOST_IP $host_key" > ~/.ssh/known_hosts | |
| - run: ./prep.sh | |
| - name: Build and deploy | |
| run: nix run .#deployAll |