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
Some checks failed
Build and Push Docker Image / build (push) Failing after 5s
This commit is contained in:
@@ -11,19 +11,21 @@ jobs:
|
||||
steps:
|
||||
- name: Clone repository
|
||||
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 }}
|
||||
env:
|
||||
GIT_ASKPASS: /bin/echo
|
||||
GIT_USERNAME: ${{ gitea.actor }}
|
||||
GIT_PASSWORD: ${{ secrets.GITEATOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
run: |
|
||||
# Login to registry
|
||||
echo "${{ secrets.GITEATOKEN }}" | docker login "${{ gitea.server_url }}" -u "${{ gitea.actor }}" --password-stdin
|
||||
|
||||
# Build with correct image format (no https://)
|
||||
# Format: registry-host/owner/image:tag
|
||||
# Build with correct image format
|
||||
IMAGE_NAME="git.eurekin.pl/${{ gitea.repository_owner }}/hello-gitea"
|
||||
|
||||
# Ensure lowercase
|
||||
IMAGE_NAME=$(echo "$IMAGE_NAME" | tr '[:upper:]' '[:lower:]')
|
||||
|
||||
echo "Building image: $IMAGE_NAME:latest"
|
||||
|
||||
Reference in New Issue
Block a user