Skip to content

[#] Build docker image using nix instead of github action #40

[#] Build docker image using nix instead of github action

[#] Build docker image using nix instead of github action #40

Workflow file for this run

name: "Build Nix package on NixOS"
on:
push:
jobs:
nix-build:
runs-on:
labels: [nixos, X64]
steps:
- uses: actions/checkout@v4
- name: Building package
run: nix build '.#main'
- name: Build docker image
run: |
nix build '.#docker'
ls -lah $(readlink ./result)
docker load -i ./result
- name: Login to Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Retag and push
if: github.repository == 'nextdotid/relation_server'
run: |
docker tag nextdotid/relation_server:latest ghcr.io/${{ github.repository }}:${{ github.ref_name }}
docker push ghcr.io/${{ github.repository }}:${{ github.ref_name }}