content: tailscale on the rocks #74
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: Fly Deploy | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
packages: write | |
jobs: | |
deploy: | |
name: Deploy app | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install nix | |
uses: DeterminateSystems/nix-installer-action@v13 | |
- name: Setup magic-nix-cache | |
uses: DeterminateSystems/magic-nix-cache-action@main | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build container | |
run: | | |
nix build -L .#jnsgruk-container | |
- name: Upload container to ghcr.io | |
run: | | |
docker load < result | |
docker tag "jnsgruk/jnsgr.uk:$(git rev-parse --short HEAD)" "ghcr.io/jnsgruk/jnsgr.uk:$(git rev-parse --short HEAD)" | |
docker push "ghcr.io/jnsgruk/jnsgr.uk:$(git rev-parse --short HEAD)" | |
- name: Deploy site | |
run: | | |
nix run nixpkgs#flyctl -- deploy -i "ghcr.io/jnsgruk/jnsgr.uk:$(git rev-parse --short HEAD)" | |
env: | |
FLY_ACCESS_TOKEN: ${{ secrets.FLY_API_TOKEN }} |