-
Notifications
You must be signed in to change notification settings - Fork 4
90 lines (86 loc) · 2.63 KB
/
sensu-catalog.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
---
name: 'Sensu Catalog Workflow'
on:
workflow_call:
inputs:
cache_key:
type: string
default: |
${{ github.workflow }}-${{ github.run_number }}-${{ github.run_attempt }}
catalog_api_version:
type: string
default: '0.1.0-alpha.14'
catalog_temp_dir:
type: string
default: './tmp'
catalog_snapshot:
type: boolean
default: false
catalog_version_file:
type: string
secrets:
aws_s3_bucket:
required: true
aws_access_key_id:
required: true
aws_secret_access_key:
required: true
aws_region:
required: true
jobs:
validate:
name: 'Validate Sensu Catalog'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0 # The whole repository must be cloned
- name: Run Sensu Catalog validation
uses: ./.github/actions/validate-catalog
with:
catalog-api-version: ${{ inputs.catalog_api_version }}
generate:
name: 'Generate Sensu Catalog API'
runs-on: ubuntu-latest
needs: validate
outputs:
release-dir: ${{ steps.generate-api.outputs.release-dir }}
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0 # The whole repository must be cloned
- name: Setup Cache
uses: actions/cache@v2
with:
path: ${{ inputs.catalog_temp_dir }}
key: ${{ inputs.cache_key }}
- name: Run Sensu Catalog API generation
uses: ./.github/actions/generate-catalog-api
id: generate-api
with:
catalog-api-version: ${{ inputs.catalog_api_version }}
snapshot: ${{ inputs.catalog_snapshot }}
temp-dir: ${{ inputs.catalog_temp_dir }}
publish:
name: 'Publish Sensu Catalog API'
runs-on: ubuntu-latest
needs: generate
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0 # The whole repository must be cloned
- name: Restore Cache
uses: actions/cache@v2
with:
path: ${{ inputs.catalog_temp_dir }}
key: ${{ inputs.cache_key }}
- name: Run Sensu Catalog API publisher
uses: ./.github/actions/publish-catalog-api
with:
release-dir: ${{ needs.generate.outputs.release-dir }}
version-file: ${{ inputs.catalog_version_file }}
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}