diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 30167d6..b2ee8bc 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -24,6 +24,9 @@ jobs: with: fetch-depth: 0 + - name: Generate Timestamp Tag + run: echo "BUILD_TIME=$(date +'%Y%m%d-%H%M%S')" >> $GITHUB_ENV + - name: Log in to Gitea Container Registry uses: docker/login-action@v2 with: @@ -37,7 +40,7 @@ jobs: context: . push: true tags: | - ${{ env.IMAGE_NAME }}:${{ gitea.sha }} + ${{ env.IMAGE_NAME }}:${{ env.BUILD_TIME }} ${{ env.IMAGE_NAME }}:latest - name: Checkout Infra Repository Manually @@ -60,7 +63,7 @@ jobs: cat charts/slashroot/values.yaml # The sed command (Make sure the path matches perfectly!) - sed -i "s/tag: .*/tag: ${{ gitea.sha }}/g" charts/slashroot/values.yaml + sed -i 's/tag: .*/tag: "${{ env.BUILD_TIME }}"/g' charts/slashroot/values.yaml echo "--- TARGET FILE AFTER ---" cat charts/slashroot/values.yaml @@ -76,6 +79,6 @@ jobs: exit 1 else echo "✅ Changes detected! Committing and pushing..." - git commit -m "BOT: (deploy) slashroot-cc update ${{ gitea.sha }}" + git commit -m "BOT: (deploy) slashroot-cc update ${{ env.BUILD_TIME }}" git push origin main fi