From eb31acbb75641ec67eba4d643d47300b84ee24eb Mon Sep 17 00:00:00 2001 From: Dan Cline <6798349+Rjected@users.noreply.github.com> Date: Wed, 18 Sep 2024 15:39:13 -0400 Subject: [PATCH] try to use artifacts --- .github/workflows/docker-push.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/docker-push.yml b/.github/workflows/docker-push.yml index 20c5b2cd2d8d..bb3bf897853c 100644 --- a/.github/workflows/docker-push.yml +++ b/.github/workflows/docker-push.yml @@ -15,12 +15,25 @@ jobs: build: name: Build all images runs-on: ubuntu-20.04 + permissions: + packages: write + contents: read steps: - uses: actions/checkout@v4 - name: Run make golang-docker run: | make golang-docker + - name: Put all docker images in temp dir + run: | + docker image ls | grep 'us-.*oplabs.*latest' | sed 's/latest.*//' | xargs -L1 -I % echo 'docker image save % -o /tmp/%.tar' | sed 's:/tmp/.*/\(.*\.tar\):/tmp/\1:' | bash + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: op-images + path: /tmp/op-*.tar + push: name: Tag and push all images runs-on: ubuntu-20.04 @@ -32,6 +45,15 @@ jobs: packages: write contents: read steps: + - name: Download built artifact + uses: actions/download-artifact@v4 + with: + name: op-images + path: ${{ matrix.image }}.tar + + - name: Import image + run | docker image import ${{ matrix.image }}.tar + - name: Log in to Docker run: | echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io --username ${DOCKER_USERNAME} --password-stdin