diff --git a/.forgejo/workflows/docker-build-onDispatch.yml b/.forgejo/workflows/docker-build-onDispatch.yml new file mode 100644 index 0000000..67cc3e1 --- /dev/null +++ b/.forgejo/workflows/docker-build-onDispatch.yml @@ -0,0 +1,48 @@ +on: + workflow_dispatch: + +jobs: + build: + runs-on: docker + container: + image: alpine:latest + steps: + - name: install dependencies + run: | + apk add --no-cache git nodejs docker qemu openrc + rc-update add docker default + + - name: Wait for Docker daemon + run: | + timeout=300 # Set a timeout value in seconds + until docker info; do + echo "Waiting for Docker daemon to start..." + sleep 5 + timeout=$((timeout-5)) + if [ $timeout -le 0 ]; then + echo "Timeout waiting for Docker daemon to start." + exit 1 + fi + done + + - name: checkout + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: "amd64,arm64" + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push Docker image + env: + DOCKER_REGISTRY: docker.registry.jk-effects.cloud + DOCKER_IMAGE_NAME: ehrenamt/member-administration/ui + run: | + docker buildx build \ + -t $DOCKER_REGISTRY/$DOCKER_IMAGE_NAME:latest \ + --platform linux/amd64,linux/arm64 -f /Dockerfile . + + docker push $DOCKER_REGISTRY/$DOCKER_IMAGE_NAME:latest diff --git a/.forgejo/workflows/docker-build-onTag.yml b/.forgejo/workflows/docker-build-onTag.yml new file mode 100644 index 0000000..8dfbff2 --- /dev/null +++ b/.forgejo/workflows/docker-build-onTag.yml @@ -0,0 +1,36 @@ +on: + push: + tags: + - "v*" +jobs: + build: + runs-on: docker + container: + image: docker:dind-rootless + steps: + - name: checkout + 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 + + - name: Extract tag + run: echo "TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV + + - name: Build and push Docker image + env: + DOCKER_REGISTRY: docker.registry.jk-effects.cloud + DOCKER_IMAGE_NAME: ehrenamt/member-administration/ui + TAG: ${{ env.TAG }} + ADDITIONAL_TAG: latest + run: | + docker buildx build \ + -t $DOCKER_REGISTRY/$DOCKER_IMAGE_NAME:$TAG \ + -t $DOCKER_REGISTRY/$DOCKER_IMAGE_NAME:$ADDITIONAL_TAG \ + --platform linux/amd64,linux/arm64 -f /Dockerfile . + + docker push $DOCKER_REGISTRY/$DOCKER_IMAGE_NAME:$TAG + docker push $DOCKER_REGISTRY/$DOCKER_IMAGE_NAME:$ADDITIONAL_TAG