ci: use gitea container hostname for internal network communication #45
@@ -15,7 +15,8 @@ jobs:
|
||||
with:
|
||||
repository: ${{ github.repository }}
|
||||
token: ${{ secrets.GITEA_TOKEN }}
|
||||
repository-url: http://172.17.0.1:3000/${{ github.repository }}
|
||||
# Nutze den Container-Namen "gitea" anstelle der IP/Host-Adresse
|
||||
repository-url: http://gitea:3000/${{ github.repository }}
|
||||
ref: main
|
||||
|
||||
- name: Read Version from package.json
|
||||
@@ -26,7 +27,7 @@ jobs:
|
||||
- name: Log in to Gitea Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: 172.17.0.1:3000
|
||||
registry: gitea:3000
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITEA_TOKEN }}
|
||||
|
||||
@@ -36,8 +37,8 @@ jobs:
|
||||
context: .
|
||||
push: true
|
||||
tags: |
|
||||
172.17.0.1:3000/${{ github.repository }}:v${{ env.VERSION }}
|
||||
172.17.0.1:3000/${{ github.repository }}:latest
|
||||
gitea:3000/${{ github.repository }}:v${{ env.VERSION }}
|
||||
gitea:3000/${{ github.repository }}:latest
|
||||
|
||||
create-release:
|
||||
name: Create Gitea Release
|
||||
@@ -49,7 +50,7 @@ jobs:
|
||||
with:
|
||||
repository: ${{ github.repository }}
|
||||
token: ${{ secrets.GITEA_TOKEN }}
|
||||
repository-url: http://172.17.0.1:3000/${{ github.repository }}
|
||||
repository-url: http://gitea:3000/${{ github.repository }}
|
||||
ref: main
|
||||
|
||||
- name: Create Release via Gitea API
|
||||
@@ -62,10 +63,10 @@ jobs:
|
||||
PRERELEASE="false"
|
||||
fi
|
||||
|
||||
# Prüfen, ob der Release bereits existiert
|
||||
# API-Aufruf über den Hostnamen "gitea"
|
||||
HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
|
||||
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||
"http://172.17.0.1:3000/api/v1/repos/${{ github.repository }}/releases/tags/v$VERSION")
|
||||
"http://gitea:3000/api/v1/repos/${{ github.repository }}/releases/tags/v$VERSION")
|
||||
|
||||
if [ "$HTTP_STATUS" -eq 404 ]; then
|
||||
echo "Creating release v$VERSION in Gitea..."
|
||||
@@ -80,7 +81,7 @@ jobs:
|
||||
\"draft\": false,
|
||||
\"prerelease\": $PRERELEASE
|
||||
}" \
|
||||
"http://172.17.0.1:3000/api/v1/repos/${{ github.repository }}/releases"
|
||||
"http://gitea:3000/api/v1/repos/${{ github.repository }}/releases"
|
||||
else
|
||||
echo "Release v$VERSION exists already. Skipping."
|
||||
fi
|
||||
Reference in new issue
Block a user