This commit is contained in:
parent
76887c3ab5
commit
90b8b429e1
1 changed files with 11 additions and 7 deletions
|
@ -48,12 +48,14 @@ jobs:
|
|||
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Docker
|
||||
# Install skopeo from Nix (for daemonless image operations)
|
||||
- name: Install skopeo
|
||||
run: |
|
||||
mkdir -p ~/.local/bin
|
||||
nix build -I nixpkgs=channel:nixos-unstable nixpkgs#docker -o ~/.local/docker
|
||||
ln -sf ~/.local/docker/bin/docker ~/.local/bin/docker
|
||||
nix build -I nixpkgs=channel:nixos-unstable nixpkgs#skopeo -o ~/.local/skopeo
|
||||
ln -sf ~/.local/skopeo/bin/skopeo ~/.local/bin/skopeo
|
||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
skopeo --version
|
||||
|
||||
- name: Log into registry ${{ env.REGISTRY }}
|
||||
if: github.event_name != 'pull_request'
|
||||
|
@ -83,11 +85,13 @@ jobs:
|
|||
echo "STRIP_REPO_USERNAME=${STRIP_REPO_USERNAME}" >> ${GITHUB_ENV}
|
||||
|
||||
# https://github.com/docker/build-push-action/issues/538
|
||||
- name: Push and tag Docker image
|
||||
- name: Push Docker image with skopeo
|
||||
run: |
|
||||
docker load < result
|
||||
docker tag ${{ env.STRIP_REPO_USERNAME }}:latest ${{ env.REGISTRY }}/${{ env.REPO }}:latest
|
||||
docker push ${{ env.REGISTRY }}/${{ env.REPO }}:latest
|
||||
# Copy the image directly from the Nix result to the registry
|
||||
skopeo copy \
|
||||
--dest-creds ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }} \
|
||||
docker-archive:result \
|
||||
docker://${{ env.REGISTRY }}/${{ env.REPO }}:latest
|
||||
|
||||
- name: Push to attic
|
||||
if: always()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue