tangled
alpha
login
or
join now
futur.blue
/
pegasus
56
fork
atom
objective categorical abstract machine language personal data server
56
fork
atom
overview
issues
2
pulls
pipelines
Retry build on network error
futur.blue
2 months ago
9c52ddd9
cef3dac1
verified
This commit was signed with the committer's
known signature
.
futur.blue
SSH Key Fingerprint:
SHA256:QHGqHWNpqYyw9bt8KmPuJIyeZX9SZewBZ0PR1COtKQ0=
+46
-12
1 changed file
expand all
collapse all
unified
split
.github
workflows
build.yml
+46
-12
.github/workflows/build.yml
···
26
26
run: echo "git_rev=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
27
27
28
28
- name: Build and push
29
29
-
uses: docker/build-push-action@v6
29
29
+
uses: Wandalen/wretry.action@v3
30
30
with:
31
31
-
push: true
32
32
-
tags: ghcr.io/futurgh/pegasus:${{ github.sha }}-amd64
33
33
-
build-args: GIT_REV=${{ steps.rev_parse.outputs.git_rev }}
34
34
-
cache-from: type=gha,scope=amd64
35
35
-
cache-to: type=gha,scope=amd64,mode=max
31
31
+
attempt_limit: 3
32
32
+
retry_condition: steps._this.outputs.retryable != 'false'
33
33
+
command: |
34
34
+
set +e
35
35
+
output=$(docker buildx build \
36
36
+
--push \
37
37
+
--tag ghcr.io/futurgh/pegasus:${{ github.sha }}-amd64 \
38
38
+
--build-arg GIT_REV=${{ steps.rev_parse.outputs.git_rev }} \
39
39
+
--cache-from type=gha,scope=amd64 \
40
40
+
--cache-to type=gha,scope=amd64,mode=max \
41
41
+
. 2>&1)
42
42
+
exit_code=$?
43
43
+
echo "$output"
44
44
+
if [ $exit_code -eq 0 ]; then
45
45
+
exit 0
46
46
+
elif echo "$output" | grep -qE "download failed|50[0-9]|Connection (refused|reset|timed out)"; then
47
47
+
echo "retrying network error"
48
48
+
exit 1
49
49
+
else
50
50
+
echo "retryable=false" >> $GITHUB_OUTPUT
51
51
+
exit 1
52
52
+
fi
36
53
37
54
build-arm64:
38
55
runs-on: ubuntu-24.04-arm
···
54
71
run: echo "git_rev=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
55
72
56
73
- name: Build and push
57
57
-
uses: docker/build-push-action@v6
74
74
+
uses: Wandalen/wretry.action@v3
58
75
with:
59
59
-
push: true
60
60
-
tags: ghcr.io/futurgh/pegasus:${{ github.sha }}-arm64
61
61
-
build-args: GIT_REV=${{ steps.rev_parse.outputs.git_rev }}
62
62
-
cache-from: type=gha,scope=arm64
63
63
-
cache-to: type=gha,scope=arm64,mode=max
76
76
+
attempt_limit: 3
77
77
+
retry_condition: steps._this.outputs.retryable != 'false'
78
78
+
command: |
79
79
+
set +e
80
80
+
output=$(docker buildx build \
81
81
+
--push \
82
82
+
--tag ghcr.io/futurgh/pegasus:${{ github.sha }}-arm64 \
83
83
+
--build-arg GIT_REV=${{ steps.rev_parse.outputs.git_rev }} \
84
84
+
--cache-from type=gha,scope=arm64 \
85
85
+
--cache-to type=gha,scope=arm64,mode=max \
86
86
+
. 2>&1)
87
87
+
exit_code=$?
88
88
+
echo "$output"
89
89
+
if [ $exit_code -eq 0 ]; then
90
90
+
exit 0
91
91
+
elif echo "$output" | grep -qE "download failed|50[0-9]|Connection (refused|reset|timed out)"; then
92
92
+
echo "retrying network error"
93
93
+
exit 1
94
94
+
else
95
95
+
echo "retryable=false" >> $GITHUB_OUTPUT
96
96
+
exit 1
97
97
+
fi
64
98
65
99
merge:
66
100
runs-on: ubuntu-latest