From 3e6bc2f763ba48a0ae7ede77b5ae6675acce27d6 Mon Sep 17 00:00:00 2001 From: "Jeffrey C. Ollie" Date: Thu, 17 Aug 2023 12:25:07 -0500 Subject: [PATCH] update build --- .github/workflows/build.yaml | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index bb0ecb1..320dd3c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -5,9 +5,30 @@ jobs: build: runs-on: ubuntu-latest container: docker.io/jcollie/nixos-runner:latest + env: + REGISTRY: ghcr.io + REPOSITORY: jcollie/nixos-runner steps: - uses: actions/checkout@v3 - - run: nix -L build .#nixos-runner - - run: nix run .#push-container -- result --registry ghcr.io --repository jcollie/nixos-runner + - run: set + - run: nix build -L .#nixos-runner + - run: echo -n "${GITHUB_TOKEN}" | podman login --username ${GITHUB_ACTOR} --password-stdin ghcr.io env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - run: podman load --input result | sed -n -e "s/Loaded image:.\\(.*\\)/loaded-image=\\1/p" >> $GITHUB_OUTPUT + id: podman-load-image + - run: podman images + - run: podman tag "${IMAGE}" "${REGISTRY}/${REPOSITORY}:${GITHUB_RUN_NUMBER}-${GITHUB_SHA:0:8}" + env: + IMAGE: ${{ steps.podman-load-image.outputs.loaded-image }} + - run: podman tag "${IMAGE}" "${REGISTRY}/${REPOSITORY}:latest" + env: + IMAGE: ${{ steps.podman-load-image.outputs.loaded-image }} + - run: podman images + - run: podman push "${REGISTRY}/${REPOSITORY}:${GITHUB_RUN_NUMBER}-${GITHUB_SHA:0:8}" + - run: podman push "${REGISTRY}/${REPOSITORY}:latest" + - run: podman logout "${REGISTRY}" + + # - run: nix run .#push-container -- result --registry ghcr.io --repository jcollie/nixos-runner + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}