Merge pull request '.gitea/workflows/deploy.yaml aktualisiert' (#58) from chore into main
Reviewed-on: Schanbro/PsalmTafel#58
This commit was merged in pull request #58.
This commit is contained in:
commit
bdc23cc8dc
1 file changed
+12
-8
@@ -21,11 +21,15 @@ jobs:
|
||||
repository-url: http://gitea:3000/${{ github.repository }}
|
||||
ref: main
|
||||
|
||||
- name: Read Version from package.json
|
||||
- name: Read Version & Lowercase Repo Name
|
||||
run: |
|
||||
VERSION=$(jq -r '.version' package.json)
|
||||
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
|
||||
run: |
|
||||
USER_LOWER=$(echo "${{ github.actor }}" | tr '[:upper:]' '[:lower:]')
|
||||
@@ -37,13 +41,13 @@ jobs:
|
||||
context: .
|
||||
push: false
|
||||
tags: |
|
||||
gitea:3000/${{ github.repository }}:${{ github.ref_name }}
|
||||
gitea:3000/${{ github.repository }}:latest
|
||||
gitea:3000/${{ env.REPO_LOWER }}:${{ github.ref_name }}
|
||||
gitea:3000/${{ env.REPO_LOWER }}:latest
|
||||
|
||||
- name: Images zu Gitea pushen
|
||||
run: |
|
||||
docker push gitea:3000/${{ github.repository }}:${{ github.ref_name }}
|
||||
docker push gitea:3000/${{ github.repository }}:latest
|
||||
docker push gitea:3000/${{ env.REPO_LOWER }}:${{ github.ref_name }}
|
||||
docker push gitea:3000/${{ env.REPO_LOWER }}:latest
|
||||
|
||||
create-release:
|
||||
name: Create Gitea Release
|
||||
@@ -54,7 +58,7 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: ${{ github.repository }}
|
||||
token: ${{ secrets.GITEA_TOKEN }}
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
repository-url: http://gitea:3000/${{ github.repository }}
|
||||
ref: main
|
||||
|
||||
@@ -69,13 +73,13 @@ jobs:
|
||||
fi
|
||||
|
||||
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")
|
||||
|
||||
if [ "$HTTP_STATUS" -eq 404 ]; then
|
||||
echo "Creating release v$VERSION in Gitea..."
|
||||
curl -X POST \
|
||||
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{
|
||||
\"tag_name\": \"v$VERSION\",
|
||||
|
||||
Reference in new issue
Block a user