-
Notifications
You must be signed in to change notification settings - Fork 178
63 lines (59 loc) · 1.68 KB
/
app-restart-template.yml
File metadata and controls
63 lines (59 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
name: App Restart Template
on: # yamllint disable-line rule:truthy
workflow_call:
inputs:
environ:
required: true
type: string
app_url:
required: false
type: string
app_names:
required: true
type: string
jobs:
attempt1:
name: restart (${{ inputs.environ }}) attempt 1
strategy:
fail-fast: false
matrix: ${{ fromJSON(inputs.app_names) }}
uses: ./.github/workflows/restart-attempt.yml
secrets: inherit
with:
environ: ${{ inputs.environ }}
app_url: ${{ inputs.app_url }}
app: ${{ matrix.app }}
is_retry: false
attempt2:
name: restart (${{ inputs.environ }}) attempt 2
needs: attempt1
strategy:
fail-fast: false
matrix: ${{ fromJSON(inputs.app_names) }}
uses: ./.github/workflows/restart-attempt.yml
secrets: inherit
with:
environ: ${{ inputs.environ }}
app_url: ${{ inputs.app_url }}
app: ${{ matrix.app }}
is_retry: true
report_failures:
name: report failures
if: ${{ failure() && github.ref == 'refs/heads/main' }}
needs: [attempt1, attempt2]
runs-on: ubuntu-latest
steps:
- name: Create Issue if it fails 😢
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.ADD_TO_PROJECT_PAT }}
GITHUB_JOB: ${{ toJson(github)['job'] }}
GITHUB_ATTEMPTS: ${{ github.run_attempt }}
LAST_COMMIT: ${{ github.sha }}
LAST_RUN_BY: ${{ github.actor }}
RUN_ID: ${{ github.run_id }}
REPO: ${{ github.repository }}
with:
filename: datagov/.github/restart_failure.md
update_existing: true