42 lines
1.0 KiB
YAML
42 lines
1.0 KiB
YAML
name: Nix Docker Push Test
|
|
on: [push]
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Nix
|
|
uses: cachix/install-nix-action@v31
|
|
with:
|
|
extra_nix_config: |
|
|
experimental-features = nix-command flakes
|
|
|
|
- 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
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: git.zhukovsky.me
|
|
username: ${{ gitea.actor }}
|
|
password: ${{ secrets.GITEA_TOKEN }}
|
|
|
|
- name: Tag and Push
|
|
run: |
|
|
REGISTRY_IMAGE="git.zhukovsky.me/$(echo ${{ gitea.repository }}"
|
|
|
|
docker tag test-nix-hello:latest $REGISTRY_IMAGE:latest
|
|
docker push $REGISTRY_IMAGE:latest
|