ci: test docker regestry
Nix Docker Push Test / build-and-push (push) Failing after 37s
Nix with Cachix Action / test-nix (push) Failing after 26s

This commit is contained in:
2026-06-15 18:33:02 +09:00
parent dff9f45c75
commit 53e6c50ab6
2 changed files with 52 additions and 3 deletions
+35
View File
@@ -0,0 +1,35 @@
name: Nix Docker Push Test
on: [push]
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v27
- name: Build Docker Image with Nix
run: |
nix build .#dockerImage
cp result hello-image.tar.gz
- name: Load image to Local Docker
run: docker load < hello-image.tar.gz
- name: Login to Gitea Registry
run: |
echo "${{ secrets.GITEA_TOKEN }}" | docker login git.zhukovsky.me -u ${{ gitea.actor }} --password-stdin
- name: Tag and Push
run: |
# В Gitea путь к образу: <domain>/<owner>/<repo>
# Приводим к нижнему регистру для реестра
REGISTRY_IMAGE="git.zhukovsky.me/$(echo ${{ gitea.repository }} | tr '[:upper:]' '[:lower:]')"
# Находим ID образа, который мы только что загрузили (test-nix-hello:latest)
docker tag test-nix-hello:latest $REGISTRY_IMAGE:latest
docker push $REGISTRY_IMAGE:latest
+17 -3
View File
@@ -1,17 +1,31 @@
{
description = "A simple Nix flake for testing Gitea Actions";
description = "A simple Nix flake for testing Gitea Actions Docker build";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs }:
outputs = { nixpkgs, ... }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in
{
# Обычный пакет
packages.${system}.default = pkgs.hello;
# Docker образ
packages.${system}.dockerImage = pkgs.dockerTools.buildImage {
name = "test-nix-hello";
tag = "latest";
copyToRoot = pkgs.buildEnv {
name = "image-root";
paths = [ pkgs.hello pkgs.coreutils ];
pathsToLink = [ "/bin" ];
};
config = {
Cmd = [ "/bin/hello" ];
};
};
};
}