Skip to content

Commit 70f739a

Browse files
committed
testing auto-retry on failure
1 parent 7abdf5f commit 70f739a

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

.github/workflows/deploy.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ name: Deploy BlueOS Extension Image
33
on:
44
# Automatically run when a new commit is added to the repository
55
push:
6+
67
# Run manually
78
workflow_dispatch:
8-
# NOTE: caches may be removed if not run weekly
9-
# -> may be worth scheduling for every 6 days
109

1110
jobs:
1211
deploy-docker-image:
@@ -23,3 +22,14 @@ jobs:
2322
author-email: ${{ vars.MY_EMAIL }}
2423
maintainer: ${{ vars.ORG_NAME }}
2524
maintainer-email: ${{ vars.ORG_EMAIL }}
25+
# Source: https://github.com/orgs/community/discussions/67654#discussioncomment-8038649
26+
on-fail-deploy-docker-image:
27+
needs: deploy-docker-image
28+
if: failure() && fromJSON(github.run_attempt) < 5
29+
runs-on: ubuntu-latest
30+
steps:
31+
- env:
32+
GH_REPO: ${{ github.repository }}
33+
GH_TOKEN: ${{ github.token }}
34+
GH_DEBUG: api
35+
run: gh workflow run rerun.yml -F run_id=${{ github.run_id }}

.github/workflows/rerun.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Source: https://github.com/orgs/community/discussions/67654#discussioncomment-8038649
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
run_id:
7+
required: true
8+
jobs:
9+
rerun:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: rerun ${{ inputs.run_id }}
13+
env:
14+
GH_REPO: ${{ github.repository }}
15+
GH_TOKEN: ${{ github.token }}
16+
GH_DEBUG: api
17+
run: |
18+
gh run watch ${{ inputs.run_id }} > /dev/null 2>&1
19+
gh run rerun ${{ inputs.run_id }} --failed

0 commit comments

Comments
 (0)