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