From 9209e5db6eb6a1ff5ccf9494f564b972ff8e9d2c Mon Sep 17 00:00:00 2001 From: Jan Caha Date: Fri, 6 Sep 2024 10:02:42 +0200 Subject: [PATCH] add action --- .github/workflows/build_docker.yaml | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/build_docker.yaml diff --git a/.github/workflows/build_docker.yaml b/.github/workflows/build_docker.yaml new file mode 100644 index 0000000..2f8dabc --- /dev/null +++ b/.github/workflows/build_docker.yaml @@ -0,0 +1,35 @@ +name: Build Docker Image + +on: + release: + types: [published, edited] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Get Version from Git Tag + id: version + run: | + echo "VERSION=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV + echo "VERSION=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + file: Dockerfile + context: . + push: true + tags: "lutraconsulting/mergin-db-sync:${{steps.version.outputs.VERSION}},lutraconsulting/mergin-db-sync:latest" + \ No newline at end of file