Skip to content

Fix image DHCP with networkd #15

Fix image DHCP with networkd

Fix image DHCP with networkd #15

Workflow file for this run

name: Build NixOS Image
on:
workflow_dispatch:
push:
branches:
- main
jobs:
build-image:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Install tooling
run: |
nix profile install \
nixpkgs#nixos-generators \
nixpkgs#zstd \
nixpkgs#awscli2 \
nixpkgs#hcloud
- name: Build image
run: scripts/build-image.sh
- name: Upload image to S3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
S3_BUCKET: ${{ secrets.S3_BUCKET }}
S3_PREFIX: ${{ secrets.S3_PREFIX }}
S3_PUBLIC_URL: ${{ secrets.S3_PUBLIC_URL }}
run: |
url="$(scripts/upload-image.sh)"
echo "IMAGE_URL=${url}" >> "${GITHUB_ENV}"
- name: Import image into Hetzner
env:
HCLOUD_TOKEN: ${{ secrets.HCLOUD_TOKEN }}
HCLOUD_LOCATION: nbg1
IMAGE_DESCRIPTION: clawdinator-nixos
IMAGE_LABELS: clawdinator=true
run: scripts/import-image.sh "${IMAGE_URL}"