From 4da5c3778d9a261cbae4d27f96d05bb19ca39bc6 Mon Sep 17 00:00:00 2001 From: Worph Date: Mon, 12 Oct 2026 18:31:41 +0000 Subject: [PATCH] gitea workflow: publish to IPCR (metadec.eth) instead of ghcr --- .gitea/workflows/docker.yml | 69 +++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .gitea/workflows/docker.yml diff --git a/.gitea/workflows/docker.yml b/.gitea/workflows/docker.yml new file mode 100644 index 0000000..3a4281c --- /dev/null +++ b/.gitea/workflows/docker.yml @@ -0,0 +1,69 @@ +# Gitea twin of .github/workflows/docker.yml. Gitea runs only .gitea/workflows/ once this +# folder exists, and GitHub never reads it. +# +# Publishes to IPCR on watch.nsl.sh instead of ghcr.io: +# push ipcr-push-watch.nsl.sh/metadec.eth/: docker login as metadec.eth with the +# IPCR_PUSH_TOKEN secret (the metadec.eth namespace token from the IPCR dashboard) +# pull ipcr-watch.nsl.sh/ipns/metadec.eth/metadec.eth/: anonymous +# The runner's job image (node:22-bookworm) has no docker CLI, so the static one is +# installed first; buildx installs itself. No `type=gha` cache: the runner has none. + +name: Build and Push Docker Image + +on: + push: + branches: [main, master] + tags: ['v*'] + pull_request: + branches: [main, master] + +env: + REGISTRY: ipcr-push-watch.nsl.sh + IMAGE_NAME: metadec.eth/${{ github.event.repository.name }} + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Docker CLI + run: curl -fsSL https://download.docker.com/linux/static/stable/x86_64/docker-28.5.1.tgz | tar -xz -C /usr/local/bin --strip-components=1 docker/docker + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + version: latest + + - name: Log in to IPCR + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: metadec.eth + password: ${{ secrets.IPCR_PUSH_TOKEN }} + + - name: Extract metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=sha + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}