refactor: update git clone command to remove https prefix and streamline environment variables
Some checks failed
Build and Push Docker Image / build (push) Failing after 5s

This commit is contained in:
Grzegorz Matoga
2025-07-24 18:24:59 +02:00
parent b789f67ec7
commit cf9c95038a

View File

@@ -11,19 +11,21 @@ jobs:
steps: steps:
- name: Clone repository - name: Clone repository
run: | run: |
git clone https://${{ gitea.actor }}:${{ secrets.GITEATOKEN }}@${{ gitea.server_url }}/${{ gitea.repository }}.git . # Remove the https:// prefix since gitea.server_url already includes it
git clone ${{ gitea.server_url }}/${{ gitea.repository }}.git .
git checkout ${{ gitea.sha }} git checkout ${{ gitea.sha }}
env:
GIT_ASKPASS: /bin/echo
GIT_USERNAME: ${{ gitea.actor }}
GIT_PASSWORD: ${{ secrets.GITEATOKEN }}
- name: Build and push - name: Build and push
run: | run: |
# Login to registry # Login to registry
echo "${{ secrets.GITEATOKEN }}" | docker login "${{ gitea.server_url }}" -u "${{ gitea.actor }}" --password-stdin echo "${{ secrets.GITEATOKEN }}" | docker login "${{ gitea.server_url }}" -u "${{ gitea.actor }}" --password-stdin
# Build with correct image format (no https://) # Build with correct image format
# Format: registry-host/owner/image:tag
IMAGE_NAME="git.eurekin.pl/${{ gitea.repository_owner }}/hello-gitea" IMAGE_NAME="git.eurekin.pl/${{ gitea.repository_owner }}/hello-gitea"
# Ensure lowercase
IMAGE_NAME=$(echo "$IMAGE_NAME" | tr '[:upper:]' '[:lower:]') IMAGE_NAME=$(echo "$IMAGE_NAME" | tr '[:upper:]' '[:lower:]')
echo "Building image: $IMAGE_NAME:latest" echo "Building image: $IMAGE_NAME:latest"