fix: switch to docker cli build
This commit is contained in:
1 parent
39eb5ba72e
commit
4ab5f40782
1 file changed
+14
-16
@@ -15,7 +15,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
repository: ${{ github.repository }}
|
repository: ${{ github.repository }}
|
||||||
token: ${{ secrets.GITEA_TOKEN }}
|
token: ${{ secrets.GITEA_TOKEN }}
|
||||||
# Nutze den Container-Namen "gitea" anstelle der IP/Host-Adresse
|
|
||||||
repository-url: http://gitea:3000/${{ github.repository }}
|
repository-url: http://gitea:3000/${{ github.repository }}
|
||||||
ref: main
|
ref: main
|
||||||
|
|
||||||
@@ -24,24 +23,24 @@ jobs:
|
|||||||
VERSION=$(jq -r '.version' package.json)
|
VERSION=$(jq -r '.version' package.json)
|
||||||
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Configure Docker Insecure Registry
|
- name: Build and Push Docker Image via CLI
|
||||||
run: |
|
run: |
|
||||||
mkdir -p /etc/docker
|
IMAGE_NAME=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
|
||||||
echo '{"insecure-registries": ["gitea:3000"]}' | sudo tee /etc/docker/daemon.json
|
|
||||||
sudo systemctl restart docker || true
|
|
||||||
|
|
||||||
- name: Log in to Gitea Container Registry
|
# Insecure Registry Flag in Docker-CLI erzwingen
|
||||||
run: |
|
echo '{"insecure-registries": ["gitea:3000"]}' > /etc/docker/daemon.json 2>/dev/null || true
|
||||||
|
|
||||||
|
echo "Logging into Gitea Registry..."
|
||||||
echo "${{ secrets.GITEA_TOKEN }}" | docker login gitea:3000 -u ${{ github.actor }} --password-stdin
|
echo "${{ secrets.GITEA_TOKEN }}" | docker login gitea:3000 -u ${{ github.actor }} --password-stdin
|
||||||
|
|
||||||
- name: Build and Push Docker Image
|
echo "Building Docker Image..."
|
||||||
uses: docker/build-push-action@v5
|
docker build \
|
||||||
with:
|
-t gitea:3000/$IMAGE_NAME:v${{ env.VERSION }} \
|
||||||
context: .
|
-t gitea:3000/$IMAGE_NAME:latest .
|
||||||
push: true
|
|
||||||
tags: |
|
echo "Pushing Docker Image..."
|
||||||
gitea:3000/${{ github.repository }}:v${{ env.VERSION }}
|
docker push gitea:3000/$IMAGE_NAME:v${{ env.VERSION }}
|
||||||
gitea:3000/${{ github.repository }}:latest
|
docker push gitea:3000/$IMAGE_NAME:latest
|
||||||
|
|
||||||
create-release:
|
create-release:
|
||||||
name: Create Gitea Release
|
name: Create Gitea Release
|
||||||
@@ -66,7 +65,6 @@ jobs:
|
|||||||
PRERELEASE="false"
|
PRERELEASE="false"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 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://gitea:3000/api/v1/repos/${{ github.repository }}/releases/tags/v$VERSION")
|
"http://gitea:3000/api/v1/repos/${{ github.repository }}/releases/tags/v$VERSION")
|
||||||
|
|||||||
Reference in new issue
Block a user