-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (55 loc) · 1.82 KB
/
ci.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
# feature-flags-preview.yaml
name: Cosmo Previews
on:
pull_request:
branches:
- main
paths:
- 'subgraphs/employees/schema.graphql'
- 'subgraphs/family/schema.graphql'
- 'subgraphs/products/schema.graphql'
- 'subgraphs/hobbies/schema.graphql'
types:
- opened
- reopened
- closed
- synchronize
jobs:
create:
runs-on: ubuntu-latest
if: github.event.action == 'opened' || github.event.action == 'reopened'
steps:
# 1. Create & Publish feature subgraph based on cosmo.yaml
# 2. Create a new feature flag
- uses: ./action.yml
id: ff
with:
config_path: .github/cosmo.yaml
create: true # Create the feature flag + subgraphs from cosmo.yaml
cosmo_api_key: ${{ secrets.COSMO_API_KEY }}
- run: |
echo "Feature flag has been created. You can now provision the subgraph service."
# run the job to deploy all the changed subgraphs here.
update:
runs-on: ubuntu-latest
if: github.event.action == 'synchronize'
steps:
- uses: ./action.yml
with:
config_path: .github/cosmo.yaml
update: true # Only update the feature subgraphs from cosmo.yaml
cosmo_api_key: ${{ secrets.COSMO_API_KEY }}
- run: |
echo "Feature subgraph has been updated. You can now update the subgraph service."
destroy:
runs-on: ubuntu-latest
if: github.event.action == 'closed'
steps:
- uses: ./action.yml
id: ff
with:
config_path: .github/cosmo.yaml
destroy: true # Only destroy the feature flag + subgraphs from cosmo.yaml
cosmo_api_key: ${{ secrets.COSMO_API_KEY }}
- run: |
echo "Feature flag and the feature subgraphs have been destroyed. You can now unprovision the subgraph services."