From 6cbe4b655d68117588a8519fd94a8728e8c24809 Mon Sep 17 00:00:00 2001 From: Ivan Berman Date: Mon, 12 Aug 2024 16:20:37 +0300 Subject: [PATCH] Create docker-image-build.yml --- .github/workflows/docker-image-build.yml | 44 ++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/docker-image-build.yml diff --git a/.github/workflows/docker-image-build.yml b/.github/workflows/docker-image-build.yml new file mode 100644 index 0000000..c9e3107 --- /dev/null +++ b/.github/workflows/docker-image-build.yml @@ -0,0 +1,44 @@ +name: Build Docker Image + +on: + push: + branches: [ main ] + tags: + - "*" + workflow_dispatch: + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata (tags, labels) for image builder + uses: docker/metadata-action@v5 + id: meta + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: type=raw,enable=true,priority=200,value=humble + - name: Build and push container image + uses: docker/build-push-action@v6 + with: + context: . + push: true + platforms: linux/arm64 + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}