From 9e8c71e13ed8af76f0061aa4f7b8cdc9327c7066 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Mon, 11 Aug 2025 18:44:34 +0000 Subject: [PATCH] deploy image when tagging (#792) Reviewed-on: https://gitea.com/gitea/tea/pulls/792 Reviewed-by: techknowlogick Co-authored-by: Lunny Xiao Co-committed-by: Lunny Xiao --- .gitea/workflows/release-tag.yml | 40 ++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/.gitea/workflows/release-tag.yml b/.gitea/workflows/release-tag.yml index 2562009..8254c56 100644 --- a/.gitea/workflows/release-tag.yml +++ b/.gitea/workflows/release-tag.yml @@ -39,3 +39,43 @@ jobs: GPGSIGN_PASSPHRASE: ${{ secrets.GPGSIGN_PASSPHRASE }} GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} GITEA_TOKEN: ${{ secrets.RELEASE_TOKEN }} + release-image: + runs-on: ubuntu-latest + env: + DOCKER_ORG: gitea + DOCKER_LATEST: nightly + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 # all history for all branches and tags + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker BuildX + uses: docker/setup-buildx-action@v3 + + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Get tag version without v + id: get_version + run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV + + - name: Build and push + uses: docker/build-push-action@v6 + env: + ACTIONS_RUNTIME_TOKEN: '' # See https://gitea.com/gitea/act_runner/issues/119 + with: + context: . + file: ./Dockerfile + platforms: | + linux/amd64 + linux/arm64 + push: true + tags: | + gitea/tea:${{ env.VERSION }} \ No newline at end of file