diff --git a/.gitea/workflows/docker-build.yml b/.gitea/workflows/docker-build.yml new file mode 100644 index 0000000..60d4a7b --- /dev/null +++ b/.gitea/workflows/docker-build.yml @@ -0,0 +1,44 @@ +name: Docker Build and Push (ext) + +on: + push: + branches: + - ext + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Derive DOCKER_TAG from commit message or fallback + id: tag + run: | + msg=$(git log -1 --pretty=%B | tr -d '\r') + tag=$(printf '%s' "$msg" | sed -n 's/.*docker_tag=\([A-Za-z0-9._-]\+\).*/\1/p' | head -n1) + if [ -z "$tag" ]; then tag=dev-test; fi + tag=$(printf '%s' "$tag" | tr -d '[:space:]') + echo "DOCKER_TAG=$tag" >> $GITHUB_ENV + echo "tag=$tag" >> $GITHUB_OUTPUT + + - name: Log in to registry + uses: docker/login-action@v3 + with: + registry: git.4nkweb.com + username: ${{ secrets.USER }} + password: ${{ secrets.TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/amd64 + push: true + tags: | + git.4nkweb.com/4nk/ihm_client:${{ env.DOCKER_TAG }} + +