From 8f00676623bcfbe857f3b8650f074b6d8c51706a Mon Sep 17 00:00:00 2001 From: khalil Date: Sat, 4 Jul 2026 18:37:08 +0000 Subject: [PATCH] ci: provide CR_PAT to actions/checkout for git push --- .gitea/workflows/deploy.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index d01df74..be4b43d 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -38,19 +38,20 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + token: ${{ secrets.CR_PAT }} - name: Log in to Gitea Container Registry - run: echo "${{ secrets.CR_PAT }}" | docker login https://git.khalilaliouich.com -u ${{ github.actor }} --password-stdin || echo "${{ secrets.CR_PAT }}" | docker login https://git.khalilaliouich.com -u ${{ github.actor }} --password-stdin + run: echo "${{ secrets.CR_PAT }}" | docker login https://git.khalilaliouich.com -u ${{ github.actor }} --password-stdin - name: Build and Push API run: | docker build --network=host -t git.khalilaliouich.com/${{ github.repository_owner }}/tamagotchi-api:${{ github.sha }} ./api - docker push git.khalilaliouich.com/${{ github.repository_owner }}/tamagotchi-api:${{ github.sha }} || (docker tag git.khalilaliouich.com/${{ github.repository_owner }}/tamagotchi-api:${{ github.sha }} git.khalilaliouich.com/${{ github.repository_owner }}/tamagotchi-api:${{ github.sha }} && docker push git.khalilaliouich.com/${{ github.repository_owner }}/tamagotchi-api:${{ github.sha }}) + docker push git.khalilaliouich.com/${{ github.repository_owner }}/tamagotchi-api:${{ github.sha }} - name: Build and Push Frontend run: | docker build --network=host -t git.khalilaliouich.com/${{ github.repository_owner }}/tamagotchi-frontend:${{ github.sha }} ./frontend - docker push git.khalilaliouich.com/${{ github.repository_owner }}/tamagotchi-frontend:${{ github.sha }} || (docker tag git.khalilaliouich.com/${{ github.repository_owner }}/tamagotchi-frontend:${{ github.sha }} git.khalilaliouich.com/${{ github.repository_owner }}/tamagotchi-frontend:${{ github.sha }} && docker push git.khalilaliouich.com/${{ github.repository_owner }}/tamagotchi-frontend:${{ github.sha }}) + docker push git.khalilaliouich.com/${{ github.repository_owner }}/tamagotchi-frontend:${{ github.sha }} - name: Update Kubernetes Manifests run: | @@ -61,7 +62,6 @@ jobs: run: | git config --global user.name "gitea-actions[bot]" git config --global user.email "gitea-actions@gitea.local" - git remote set-url origin http://${{ github.actor }}:${{ secrets.CR_PAT }}@git.khalilaliouich.com/${{ github.repository }} git add api-deployment.yaml frontend-deployment.yaml git commit -m "chore: deploy version ${{ github.sha }} [skip ci]" || echo "No changes to commit" git push origin main