From eeeba0f9e60fb742c7a8205672d71bab2d151f08 Mon Sep 17 00:00:00 2001 From: Gil Maimon Date: Sat, 27 Jul 2024 00:43:58 +0300 Subject: [PATCH] Update cicd.yaml --- .github/workflows/cicd.yaml | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index 246172c..068c57c 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -17,8 +17,17 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - - name: Build Docker image - run: docker build -t server:latest . + - name: Build and export + uses: docker/build-push-action@v6 + with: + tags: server:latest + outputs: type=docker,dest=/tmp/myimage.tar + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: myimage + path: /tmp/myimage.tar deploy: needs: build # Ensure deploy job waits for build job @@ -30,6 +39,17 @@ jobs: with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - + + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: myimage + path: /tmp + + - name: Load image + run: | + docker load --input /tmp/myimage.tar + docker image ls -a + - name: Push Docker image run: docker push server:latest