mirror of
https://github.com/CJackHwang/ds2api.git
synced 2026-05-05 00:45:29 +08:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf2f79b6f4 | ||
|
|
ab6e817c8e | ||
|
|
9ae4630a3b | ||
|
|
d1b8537cfb | ||
|
|
d32b4481da |
33
.github/workflows/release-artifacts.yml
vendored
33
.github/workflows/release-artifacts.yml
vendored
@@ -85,12 +85,30 @@ jobs:
|
|||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Log in to GHCR
|
- name: Wait for GHCR endpoint
|
||||||
uses: docker/login-action@v3
|
run: |
|
||||||
with:
|
set -euo pipefail
|
||||||
registry: ghcr.io
|
for i in {1..6}; do
|
||||||
username: ${{ github.actor }}
|
code="$(curl -sS -o /dev/null -w '%{http_code}' --max-time 15 https://ghcr.io/v2/ || true)"
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
if [ "${code}" = "200" ] || [ "${code}" = "401" ] || [ "${code}" = "405" ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
sleep "$((i * 10))"
|
||||||
|
done
|
||||||
|
echo "GHCR endpoint is unreachable after multiple retries (last status: ${code:-unknown})." >&2
|
||||||
|
exit 1
|
||||||
|
|
||||||
|
- name: Log in to GHCR (with retry)
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
for i in {1..6}; do
|
||||||
|
if echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
sleep "$((i * 10))"
|
||||||
|
done
|
||||||
|
echo "Failed to login to GHCR after multiple retries." >&2
|
||||||
|
exit 1
|
||||||
|
|
||||||
- name: Extract Docker metadata
|
- name: Extract Docker metadata
|
||||||
id: meta_release
|
id: meta_release
|
||||||
@@ -104,6 +122,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Build and Push Docker Image
|
- name: Build and Push Docker Image
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
|
env:
|
||||||
|
DOCKER_BUILD_RECORD_UPLOAD: "false"
|
||||||
|
DOCKER_BUILD_SUMMARY: "false"
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
|
|||||||
Reference in New Issue
Block a user