feat: add image upload step to nix workflow
Some checks failed
/ build (push) Failing after 1m30s

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.
This commit is contained in:
Harald Hoyer 2024-06-27 15:24:22 +02:00
parent 1fd6733cfc
commit 9a8ec862c2

View file

@ -5,3 +5,10 @@ jobs:
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"