From 5efdad5c5c80328784fe4f2a57f3d36e5ad00948 Mon Sep 17 00:00:00 2001 From: Bulat Kurbanov Date: Wed, 15 May 2024 23:58:55 +0200 Subject: [PATCH] Add build workflow --- .github/workflows/build_docker_image.yml | 44 ++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/build_docker_image.yml diff --git a/.github/workflows/build_docker_image.yml b/.github/workflows/build_docker_image.yml new file mode 100644 index 0000000..58ea0cf --- /dev/null +++ b/.github/workflows/build_docker_image.yml @@ -0,0 +1,44 @@ +name: Build docker image + +on: + push: + branches: + - 'master' + +jobs: + Build-Docker-Image: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v4 + + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - id: repository_name + uses: ASzc/change-string-case-action@v6 + with: + string: ${{ github.repository }} + + - + name: Login to ghcr.io + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - + name: Build and push + id: docker_build + uses: docker/build-push-action@v5 + env: + IMAGE: ${{ steps.repository_name.outputs.lowercase }} + with: + push: true + platforms: linux/amd64 + tags: ghcr.io/${{ env.IMAGE }}:latest + context: . + file: ./docker/build.dockerfile