From c10dab32f25b9c7045aac23a0bfed3d5ba57576f Mon Sep 17 00:00:00 2001 From: huangyi Date: Thu, 20 Jun 2024 08:25:38 +0800 Subject: [PATCH] fix skopeo --- .github/workflows/container.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index fe40053d3f..f55a5ce1a7 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/checkout@v4 - uses: cachix/install-nix-action@v23 with: - nix_path: nixpkgs=channel:nixos-22.11 + nix_path: nixpkgs=channel:nixos-24.05 extra_nix_config: | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - uses: cachix/cachix-action@v12 @@ -31,8 +31,10 @@ jobs: signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}" - name: build and push image run: | - REPO_NAME=${{ github.event.repository.name }} - TAG=${{ github.ref_name }} + REPO_NAME="${{ github.event.repository.name }}" + TAG="${{ github.ref_name }}" OCI_ARCHIVE=$(nix build --no-link --print-out-paths .#testground-image) - echo $REPO_NAME $TAG $OCI_ARCHIVE - skopeo --insecure-policy copy --dest-creds="${REPO_NAME}:${{ secrets.GITHUB_TOKEN }}" "docker-archive:${OCI_ARCHIVE}" "docker://${REPO_NAME}/testground-image:${TAG}" + USERNAME="${{ github.actor }}" + echo "$REPO_NAME $TAG $OCI_ARCHIVE" + alias skopeo="nix shell nixpkgs#skopeo -c skopeo" + skopeo --insecure-policy copy --dest-creds="${USERNAME}:${{ secrets.GITHUB_TOKEN }}" "docker-archive:${OCI_ARCHIVE}" "docker://${REPO_NAME}/testground-image:${TAG}"