From f91c4cd6a4e8c15178dbf703e977b266671c1f21 Mon Sep 17 00:00:00 2001 From: ilovintit Date: Mon, 8 Jun 2026 15:23:58 +0800 Subject: [PATCH] ci: align registry secrets with Harbor convention --- .gitea/workflows/build.yaml | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 2e325da..5bc1f20 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -3,11 +3,24 @@ on: push: branches: [main] +env: + HARBOR_IMAGE: ${{ vars.HARBOR_ADDR }}/docker-compose-updater + jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Login Harbor + uses: https://gitea.songhuwan.com/actions/login-action@v3.2.0 + with: + registry: ${{ vars.HARBOR_ADDR }} + username: ${{ secrets.HARBOR_USERNAME }} + password: ${{ secrets.HARBOR_PASSWORD }} + + - name: Checkout + uses: https://gitea.songhuwan.com/actions/checkout@v4 + with: + token: ${{ secrets.CHECKOUT_TOKEN }} - name: Build updater binary (test only) run: | @@ -15,14 +28,12 @@ jobs: go build -o /dev/null ./cmd/updater go build -o /dev/null ./cmd/dcu-send - - name: Log in to registry - run: docker login -u ${{ secrets.REGISTRY_USER }} -p ${{ secrets.REGISTRY_PASS }} ${{ secrets.REGISTRY_URL }} - - name: Build and push updater image run: | PUBLIC_KEY_BASE64=$(base64 -w0 < keys/signing-public.pem) docker build \ --build-arg PUBLIC_KEY_BASE64=$PUBLIC_KEY_BASE64 \ - -t ${{ secrets.REGISTRY_URL }}/docker-compose-updater:latest \ + -t ${{ env.HARBOR_IMAGE }}:latest \ + -t ${{ env.HARBOR_IMAGE }}:${{ github.SHA }} \ -f deploy/Dockerfile . - docker push ${{ secrets.REGISTRY_URL }}/docker-compose-updater:latest + docker push --all-tags ${{ env.HARBOR_IMAGE }}