From e5a851a3c49bb1e9f421be2898d7b34ad9a4d276 Mon Sep 17 00:00:00 2001 From: Esteban Vincent Date: Sat, 30 May 2026 22:44:41 +0200 Subject: [PATCH] ci: migrate ci-cd pipeline from github to gitea registry --- .github/workflows/ci-cd.yml | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 652b535..be847ca 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -5,11 +5,11 @@ on: branches: [main] env: - REGISTRY: ghcr.io + REGISTRY: gitea.nasvincent.com jobs: test: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 @@ -27,8 +27,7 @@ jobs: build-and-push: needs: test - environment: DEV - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 permissions: contents: write packages: write @@ -47,8 +46,8 @@ jobs: - uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.TOKEN }} - uses: docker/build-push-action@v5 with: context: . @@ -57,17 +56,17 @@ jobs: tags: | ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.new_version }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest - cache-from: type=gha - cache-to: type=gha,mode=max + cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:cache + cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:cache,mode=max - name: Create Git tag run: | - git config user.email "action@github.com" - git config user.name "GitHub Action" + git config user.email "action@gitea.nasvincent.com" + git config user.name "Gitea Action" git tag ${{ steps.version.outputs.new_version }} git push origin ${{ steps.version.outputs.new_version }} - name: Save new minor version - env: - GH_TOKEN: ${{ secrets.PAT_ADMIN_TOKEN }} - GH_REPO: ${{ github.repository }} run: | - gh variable set VERSION_MINOR --body "${{ steps.version.outputs.new_minor }}" --env DEV + curl -s -X PUT "https://gitea.nasvincent.com/api/v1/repos/${{ github.repository }}/actions/variables/VERSION_MINOR" \ + -H "Authorization: token ${{ secrets.TOKEN }}" \ + -H "Content-Type: application/json" \ + -d "{\"value\": \"${{ steps.version.outputs.new_minor }}\"}"