From 34e07515e298db0ac948bc9ed870542af04d2791 Mon Sep 17 00:00:00 2001 From: Aliaksandr Yakutovich Date: Sat, 17 Feb 2024 11:52:28 +0100 Subject: [PATCH 1/2] Docker release image action: initial version. --- .github/workflows/release-docker-image.yaml | 42 +++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/release-docker-image.yaml diff --git a/.github/workflows/release-docker-image.yaml b/.github/workflows/release-docker-image.yaml new file mode 100644 index 0000000..c8bcdb3 --- /dev/null +++ b/.github/workflows/release-docker-image.yaml @@ -0,0 +1,42 @@ +--- + +# Build and push a Docker image to GitHub Packages + +on: [push] + +name: Build and push a Docker image to GitHub Packages + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build: + name: Build + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Login to the GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + push: true + platforms: linux/amd64,linux/arm64 + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} From b335959ddfd589316a7d5255002e516c86be04f0 Mon Sep 17 00:00:00 2001 From: Aliaksandr Yakutovich Date: Sat, 17 Feb 2024 11:53:43 +0100 Subject: [PATCH 2/2] Multi-platform build is not supported for the docker driver. --- .github/workflows/release-docker-image.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release-docker-image.yaml b/.github/workflows/release-docker-image.yaml index c8bcdb3..609fcbd 100644 --- a/.github/workflows/release-docker-image.yaml +++ b/.github/workflows/release-docker-image.yaml @@ -37,6 +37,5 @@ jobs: with: context: . push: true - platforms: linux/amd64,linux/arm64 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }}