This repository has been archived by the owner on Mar 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
105 lines (102 loc) · 2.95 KB
/
workflow.yaml
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Workflow
on:
# Run on pushes to main..
push:
branches:
- main
# ..and any pull request.
pull_request:
# Allow manual triggers (required to refresh secrets/env vars)
workflow_dispatch:
# This serializes deploys from main.
concurrency:
group: env-${{ github.ref }}
jobs:
check-for-sh:
name: Check for .sh
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: "echo '*** Do not write .sh scripts! ***'; ! find . -type f -name '*.sh' | grep ."
unit:
name: unit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '18'
check-latest: true
- run: yarn
- run: yarn build
- run: yarn test
- name: Upload Coverage Report
uses: actions/upload-artifact@v2
with:
path: coverage/lcov-report
- name: 'Upload coverage to Codecov'
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '18'
check-latest: true
- run: yarn
- run: yarn lint
end-to-end:
name: end-to-end
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '18'
check-latest: true
- run: yarn
- run: yarn build
- run: yarn e2e
deploy-alfajores:
name: Deploy alfajores
if: github.ref == 'refs/heads/main'
needs:
- unit
- lint
- end-to-end
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: google-github-actions/setup-gcloud@v0
with:
service_account_key: ${{ secrets.ALFAJORES_SERVICE_ACCOUNT_KEY }}
export_default_credentials: true
- run: yarn
- name: Deploy App
run: gcloud app deploy app.alfajores.yaml --project=celo-mobile-alfajores --version="git-$(git rev-parse --short HEAD)" --quiet --promote --stop-previous-version
- name: Cleanup Versions
run: yarn cleanup-versions --service indexer --num-versions 5
deploy-mainnet:
name: Deploy mainnet
if: github.ref == 'refs/heads/main'
needs:
- unit
- lint
- end-to-end
- deploy-alfajores
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: google-github-actions/setup-gcloud@v0
with:
service_account_key: ${{ secrets.MAINNET_SERVICE_ACCOUNT_KEY }}
export_default_credentials: true
- run: yarn
- name: Deploy App
run: gcloud app deploy app.mainnet.yaml --project=celo-mobile-mainnet --version="git-$(git rev-parse --short HEAD)" --quiet --promote --stop-previous-version
- name: Cleanup Versions
run: yarn cleanup-versions --service indexer --num-versions 5