.gitea/workflows/deploy.yaml aktualisiert #58
@@ -21,11 +21,15 @@ jobs:
|
|||||||
repository-url: http://gitea:3000/${{ github.repository }}
|
repository-url: http://gitea:3000/${{ github.repository }}
|
||||||
ref: main
|
ref: main
|
||||||
|
|
||||||
- name: Read Version from package.json
|
- name: Read Version & Lowercase Repo Name
|
||||||
run: |
|
run: |
|
||||||
VERSION=$(jq -r '.version' package.json)
|
VERSION=$(jq -r '.version' package.json)
|
||||||
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
# Repository-Name in Kleinbuchstaben umwandeln (z.B. schanbro/psalmtafel)
|
||||||
|
REPO_LOWER=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
|
||||||
|
echo "REPO_LOWER=$REPO_LOWER" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Log in to Gitea Container Registry
|
- name: Log in to Gitea Container Registry
|
||||||
run: |
|
run: |
|
||||||
USER_LOWER=$(echo "${{ github.actor }}" | tr '[:upper:]' '[:lower:]')
|
USER_LOWER=$(echo "${{ github.actor }}" | tr '[:upper:]' '[:lower:]')
|
||||||
@@ -37,13 +41,13 @@ jobs:
|
|||||||
context: .
|
context: .
|
||||||
push: false
|
push: false
|
||||||
tags: |
|
tags: |
|
||||||
gitea:3000/${{ github.repository }}:${{ github.ref_name }}
|
gitea:3000/${{ env.REPO_LOWER }}:${{ github.ref_name }}
|
||||||
gitea:3000/${{ github.repository }}:latest
|
gitea:3000/${{ env.REPO_LOWER }}:latest
|
||||||
|
|
||||||
- name: Images zu Gitea pushen
|
- name: Images zu Gitea pushen
|
||||||
run: |
|
run: |
|
||||||
docker push gitea:3000/${{ github.repository }}:${{ github.ref_name }}
|
docker push gitea:3000/${{ env.REPO_LOWER }}:${{ github.ref_name }}
|
||||||
docker push gitea:3000/${{ github.repository }}:latest
|
docker push gitea:3000/${{ env.REPO_LOWER }}:latest
|
||||||
|
|
||||||
create-release:
|
create-release:
|
||||||
name: Create Gitea Release
|
name: Create Gitea Release
|
||||||
@@ -54,7 +58,7 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: ${{ github.repository }}
|
repository: ${{ github.repository }}
|
||||||
token: ${{ secrets.GITEA_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
repository-url: http://gitea:3000/${{ github.repository }}
|
repository-url: http://gitea:3000/${{ github.repository }}
|
||||||
ref: main
|
ref: main
|
||||||
|
|
||||||
@@ -69,13 +73,13 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
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.GITHUB_TOKEN }}" \
|
||||||
"http://gitea: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..."
|
||||||
curl -X POST \
|
curl -X POST \
|
||||||
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{
|
-d "{
|
||||||
\"tag_name\": \"v$VERSION\",
|
\"tag_name\": \"v$VERSION\",
|
||||||
|
|||||||
Reference in new issue
Block a user