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