From 04e1ea35a9cb65de916398936d22d59c0ec726fb Mon Sep 17 00:00:00 2001
From: Peter Galonza
Date: Mon, 27 May 2024 00:51:54 +0300
Subject: [PATCH] refactor: use docker actions
---
.github/workflows/image.yml | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml
index a47b11ec6..7ccc9729b 100644
--- a/.github/workflows/image.yml
+++ b/.github/workflows/image.yml
@@ -18,14 +18,16 @@ jobs:
contents: read
attestations: write
steps:
- - uses: actions/checkout@v4
- - name: Build image
- run: |
- docker build . --no-cache \
- --file Dockerfile --tag $IMAGE_NAME --label "runnumber=${{ github.run_id }}"
- - name: Log in to registry
- run: docker login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
- - name: Push image
- run: |
- docker tag $IMAGE_NAME ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME:latest
- docker push ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME:latest
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v3
+ - name: Login to GitHub Container Registry
+ uses: docker/login-action@v3
+ with:
+ registry: ghcr.io
+ username: ${{ github.actor }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+ - name: Build and push
+ uses: docker/build-push-action@v5
+ with:
+ push: true
+ tags: ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest