-
Notifications
You must be signed in to change notification settings - Fork 107
61 lines (58 loc) · 1.78 KB
/
app-restart-template.yml
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
---
name: App Restart Template
on: # yamllint disable-line rule:truthy
workflow_call:
inputs:
environ:
required: true
type: string
app_names:
required: true
type: string
secrets:
CF_SERVICE_USER:
required: true
CF_SERVICE_AUTH:
required: true
jobs:
restart:
name: restart (${{ inputs.environ }})
environment: ${{ inputs.environ }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJSON(inputs.app_names) }}
steps:
- name: checkout datagov
uses: actions/checkout@v4
with:
repository: gsa/data.gov
path: "./datagov"
- name: restart ${{ matrix.app }}
uses: cloud-gov/cg-cli-tools@main
with:
command: datagov/bin/check-and-renew ${{ matrix.app }} restart
cf_org: gsa-datagov
cf_space: ${{ inputs.environ }}
cf_username: ${{secrets.CF_SERVICE_USER}}
cf_password: ${{secrets.CF_SERVICE_AUTH}}
- name: smoke test
if: ${{ matrix.smoketest }}
run: |
sleep 10
curl --fail --silent ${{ inputs.app_url }}\
/api/action/status_show?$(date +%s)
- name: Create Issue if it fails 😢
if: ${{ failure() && github.ref == 'refs/heads/main' }}
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