nix-runner-container/.forgejo/workflows/nix.yaml
Harald Hoyer 9a8ec862c2
Some checks failed
/ build (push) Failing after 1m30s
feat: add image upload step to nix workflow
This commit introduces a new step to the nix workflow that includes uploading the built image to a docker registry. It also tags the image and pushes it to the user's docker registry for easier access and use.
2024-06-27 15:24:22 +02:00

15 lines
599 B
YAML

on: [push]
jobs:
build:
runs-on: nix
steps:
- uses: actions/checkout@v3
- run: nix build -L .#runner
- name: upload image
run: |
docker login -u ${{ secrets.REG_USER }} -p ${{ secrets.REG_TOKEN }} ${{ secrets.CI_REGISTRY }}
export IMAGE_TAG=$(docker load < result | grep -Po 'Loaded image.*: \K.*')
echo "Pushing image ${IMAGE_TAG}"
docker tag "${IMAGE_TAG}" "${{ secrets.CI_REGISTRY }}/${{ secrets.REG_USER }}/nix-runner:latest"
docker push "${{ secrets.CI_REGISTRY }}/${{ secrets.REG_USER }}/nix-runner:latest"