Skip to content

Commit a1f1a85

Browse files
authored
Merge pull request #38 from Tanzania-AI-Community/development
Improve CI/CD pipeline
2 parents 69e913e + 0809cf9 commit a1f1a85

File tree

3 files changed

+52
-3
lines changed

3 files changed

+52
-3
lines changed

.github/workflows/ci-cd.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CI/CD Pipeline
2+
3+
on:
4+
push:
5+
branches:
6+
- development
7+
- main
8+
pull_request:
9+
branches:
10+
- development
11+
- main
12+
13+
jobs:
14+
lint:
15+
uses: ./.github/workflows/lint.yml
16+
17+
gitguardian:
18+
uses: ./.github/workflows/gitguardian.yml
19+
secrets:
20+
GITGUARDIAN_API_KEY: ${{ secrets.GITGUARDIAN_API_KEY}}
21+
22+
deploy-dev:
23+
needs: [lint, gitguardian]
24+
if: github.ref == 'refs/heads/development' && github.event_name == 'push'
25+
runs-on: ubuntu-latest
26+
environment: development
27+
steps:
28+
- name: Deploy to Render (Development)
29+
env:
30+
deploy_url: ${{ secrets.RENDER_DEPLOY_HOOK_URL }}
31+
run: |
32+
curl "$deploy_url"
33+
34+
deploy-prod:
35+
needs: [lint, gitguardian]
36+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
37+
runs-on: ubuntu-latest
38+
environment: production
39+
steps:
40+
- name: Deploy to Render (Production)
41+
env:
42+
deploy_url: ${{ secrets.RENDER_DEPLOY_HOOK_URL }}
43+
run: |
44+
curl "$deploy_url"

.github/workflows/gitguardian.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: GitGuardian scan
22

3-
on: [push, pull_request]
3+
on:
4+
workflow_call:
5+
secrets:
6+
GITGUARDIAN_API_KEY:
7+
required: true
48

59
jobs:
610
scanning:
@@ -13,7 +17,7 @@ jobs:
1317
with:
1418
fetch-depth: 0 # fetch all history so multiple commits can be scanned
1519
- name: GitGuardian scan
16-
uses: GitGuardian/ggshield/actions/secret@v1.30.1
20+
uses: GitGuardian/ggshield/actions/secret@v1.32.0
1721
env:
1822
GITHUB_PUSH_BEFORE_SHA: ${{ github.event.before }}
1923
GITHUB_PUSH_BASE_SHA: ${{ github.event.base }}

.github/workflows/black.yml renamed to .github/workflows/lint.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Lint
22

3-
on: [push, pull_request]
3+
on:
4+
workflow_call:
45

56
jobs:
67
lint:

0 commit comments

Comments
 (0)