Skip to content

Commit a0c06ac

Browse files
authored
Merge branch 'Greenstand:main' into main
2 parents ac3f4c7 + 8c1333a commit a0c06ac

File tree

86 files changed

+1865
-1209
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+1865
-1209
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
name: Bug report
33
about: Create a report to help us improve
4-
title: ''
4+
title: ""
55
labels: bug
6-
assignees: ''
7-
6+
assignees: ""
87
---
98

109
**Describe the bug**
@@ -37,4 +36,4 @@ If applicable, add screenshots to help explain your problem.
3736
- Version [e.g. 22]
3837

3938
**Additional context**
40-
Add any other context about the problem here.
39+
Add any other context about the problem here.

.github/pull_request_template.md

+15-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
<!--
2-
---
1+
## <!--
2+
33
name: "Monorepo Contribution"
44
about: "Template for contributions in a monorepo with apps and packages folders"
55
title: "[Feature/Bug] - Title"
66
labels: ["contribution"]
7-
assignees: "" # Leave blank if no specific assignee
7+
assignees: "" # Leave blank if no specific assignee
8+
89
---
10+
911
-->
1012

1113
### Description
14+
1215
Please provide a clear and concise description of the changes made, including the purpose and context.
1316

1417
**Fixes**: # (issue number)
@@ -18,7 +21,9 @@ or
1821
---
1922

2023
### Changes Made
24+
2125
- [ ] Changes in **`apps`** folder (specify the app and briefly describe the changes):
26+
2227
- [ ] `Web`
2328
- [ ] `Native`
2429

@@ -28,6 +33,7 @@ or
2833
---
2934

3035
### Type of Change
36+
3137
- [ ] 🐛 **Bug fix** (non-breaking change which fixes an issue)
3238
- [ ]**New feature** (non-breaking change which adds functionality)
3339
- [x] 💥 **Breaking change** (fix or feature that would cause existing functionality to not work as expected)
@@ -36,19 +42,23 @@ or
3642
---
3743

3844
## Screenshots
45+
3946
| Before | After |
4047
| :-----------------: | :----------------: |
4148
| "screenshot before" | "screenshot after" |
49+
4250
---
4351

4452
### How Has This Been Tested?
53+
4554
- [ ] Cypress integration
4655
- [ ] Cypress component tests
4756
- [ ] Jest unit tests
4857

4958
---
5059

5160
### Checklist:
61+
5262
- [ ] I have performed a self-review of my own code
5363
- [ ] I have commented my code, particularly in hard-to-understand areas
5464
- [ ] I have made corresponding changes to the documentation
@@ -60,4 +70,5 @@ or
6070
---
6171

6272
### Additional Comments
63-
*(Optional) Add any additional comments or notes for reviewers here.*
73+
74+
_(Optional) Add any additional comments or notes for reviewers here._

.github/workflows/api-pr.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: CI for New Pull Requests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "*"
7+
paths:
8+
- "apps/user/**" # Only trigger for changes in the apps/user directory
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: Use Node.js 18.x
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: "18.x"
20+
21+
- name: Install dependencies for specific package
22+
run: yarn workspace user install
23+
24+
- name: Build TypeScript project
25+
run: yarn workspace user build
26+
27+
- name: Lint code with ESLint
28+
run: yarn workspace user lint
29+
30+
- name: Run unit tests
31+
run: yarn workspace user test:unit
32+
33+
- name: Run integration tests
34+
run: yarn workspace user int-test
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: Service CI/CD Pipeline to Release and Deploy to Dev Env
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- "apps/user/**" # Only trigger for changes in the apps/user directory
9+
10+
jobs:
11+
release:
12+
if: |
13+
!contains(github.event.head_commit.message, 'skip-ci')
14+
name: Build and Release Docker Image
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Use Node.js 20.x
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: "20.x"
23+
24+
- name: Yarn Clean Install
25+
run: yarn workspace user install
26+
27+
- name: Install Semantic Release
28+
run: yarn global add semantic-release @semantic-release/{git,exec,changelog}
29+
30+
- name: Semantic Release
31+
run: semantic-release
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
35+
- name: Make Build
36+
run: yarn workspace user build
37+
38+
- name: Get NPM Version
39+
id: package-version
40+
uses: martinbeentjes/npm-get-version-action@master
41+
with:
42+
path: apps/user
43+
44+
- name: Set up QEMU
45+
uses: docker/setup-qemu-action@v3
46+
47+
- name: Set up Docker Buildx
48+
uses: docker/setup-buildx-action@v3
49+
50+
- name: Login to DockerHub
51+
uses: docker/login-action@v3
52+
with:
53+
username: ${{ secrets.DOCKERHUB_USERNAME }}
54+
password: ${{ secrets.DOCKERHUB_TOKEN }}
55+
56+
- name: Build and Push Docker Image
57+
id: docker_build_release
58+
uses: docker/build-push-action@v5
59+
with:
60+
context: ./apps/user/
61+
file: ./apps/user/Dockerfile
62+
push: true
63+
tags: greenstand/treetracker-wallet-monorepo-user-api:${{ steps.package-version.outputs.current-version }}
64+
65+
outputs:
66+
bumped_version: ${{ steps.package-version.outputs.current-version }}
67+
68+
deploy:
69+
if: ${{ needs.release.result == 'success' }} && !contains(github.event.head_commit.message, 'skip-ci')
70+
name: Deploy to Dev Environment
71+
runs-on: ubuntu-latest
72+
needs: release
73+
steps:
74+
- uses: actions/checkout@v4
75+
76+
- name: Install Kustomize
77+
run: |
78+
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
79+
80+
- name: Update Kustomize Image
81+
run: |
82+
(cd apps/user/deployment/base && kustomize edit set image greenstand/treetracker-wallet-monorepo-user-api:${{ needs.release.outputs.bumped_version }})
83+
84+
- name: Install DigitalOcean CLI
85+
uses: digitalocean/action-doctl@v2
86+
with:
87+
token: ${{ secrets.DEV_DIGITALOCEAN_TOKEN }}
88+
89+
- name: Save Kubernetes Config
90+
run: doctl kubernetes cluster kubeconfig save ${{ secrets.DEV_CLUSTER_NAME }}
91+
92+
- name: Deploy to Kubernetes
93+
run: |
94+
kustomize build apps/user/deployment/overlays/development | \
95+
kubectl apply -n ${{ secrets.K8S_NAMESPACE }} --wait -f -

.github/workflows/github-ci.yml

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ jobs:
3030
name: Run cypress unit tests
3131
needs: install
3232
runs-on: ubuntu-latest
33-
3433
steps:
3534
- name: Checkout
3635
uses: actions/checkout@v4

.husky/pre-commit

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
yarn pre-commit
1+
yarn lint-staged

0 commit comments

Comments
 (0)