please
Build and Push Docker Image / docker (push) Successful in 2m56s

This commit is contained in:
2026-09-17 14:19:58 -06:00
parent 3579a4521f
commit 754aab7e2c
2 changed files with 26 additions and 1 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ jobs:
uses: actions/checkout@v4
- run: |
./.gitea/scripts/update_dockerhub_api \
./update_dockerhub_api \
${{ secrets.DOCKERHUB_USERNAME }} \
${{ secrets.DOCKERHUB_PASSWORD }} \
${{ gitea.repository }} \
+25
View File
@@ -0,0 +1,25 @@
#!/bin/bash
DOCKERHUB_USERNAME="${1}"
DOCKERHUB_PASSWORD="${2}"
GITEA_OWNER_REPO="${3}"
GITEA_API_KEY="${4}"
gitea_username=$(echo "${GITEA_OWNER_REPO}" | sed 's/\/.*//')
repo_name=$(echo "${GITEA_OWNER_REPO}" | sed 's/^.*\///')
NEW_DOCKERHUB_TOKEN=$(curl -s -X POST "https://hub.docker.com/v2/auth/token" \
-H "Content-Type: application/json" \
-d "{\"identifier\": \"${DOCKERHUB_USERNAME}\", \"secret\": \"${DOCKERHUB_PASSWORD}\"}" \
| jq -r .access_token)
curl -X 'PUT' \
"https://gitea.happylizard.me/api/v1/repos/${gitea_username}/${repo_name}/actions/secrets/DOCKERHUB_TOKEN" \
-H 'accept: application/json' \
-H "Authorization: token ${GITEA_API_KEY}" \
-H 'Content-Type: application/json' \
-d "{
\"data\": \"${NEW_DOCKERHUB_TOKEN}\",
\"description\": \"\"
}"