Skip to content

Commit 1bb814c

Browse files
Merge pull request #53 from StreetSupport/feature/merge_staging_into_main
Feature/merge staging into main
2 parents 25319a6 + 3eb5426 commit 1bb814c

File tree

111 files changed

+21870
-39
lines changed

Some content is hidden

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

111 files changed

+21870
-39
lines changed

.github/workflows/azure-deploy.yml

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,36 +15,55 @@ jobs:
1515
build:
1616
runs-on: ubuntu-latest
1717
permissions:
18-
contents: read #This is required for actions/checkout
18+
contents: read
19+
20+
env:
21+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
22+
SENTRY_ORG: ${{ vars.SENTRY_ORG }}
23+
SENTRY_PROJECT: ${{ vars.SENTRY_PROJECT }}
24+
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
25+
SENTRY_ENV: ${{ github.ref_name == 'main' && 'production' || 'staging' }}
1926

2027
steps:
2128
- uses: actions/checkout@v4
2229

2330
- name: Set up Node.js version
2431
uses: actions/setup-node@v3
2532
with:
26-
node-version: '20.x'
33+
node-version: '24.x'
2734

28-
- name: npm install, build, and test
35+
- name: Setup Sentry
36+
run: |
37+
npm install -g @sentry/cli
38+
sentry-cli --auth-token $SENTRY_AUTH_TOKEN info
39+
40+
- name: npm install, lint, build, and test
2941
run: |
3042
npm install
43+
npm run lint
3144
npm run build --if-present
3245
npm run test --if-present
3346
47+
- name: Clean build artifacts and dependencies
48+
run: rm -rf dist node_modules
49+
50+
- name: Zip artifact for deployment
51+
run: zip -r release.zip .
52+
3453
- name: Upload artifact for deployment job
3554
uses: actions/upload-artifact@v4
3655
with:
3756
name: node-app
38-
path: .
57+
path: release.zip
3958

4059
deploy:
4160
runs-on: ubuntu-latest
4261
needs: build
43-
# Update to 'Production' || 'Staging' when configure additional environment
44-
environment: ${{ github.ref_name == 'main' && 'Staging' || 'Staging' }}
62+
environment: ${{ github.ref_name == 'main' && 'production' || 'staging' }}
4563
permissions:
46-
id-token: write #This is required for requesting the JWT
47-
contents: read #This is required for actions/checkout
64+
id-token: write
65+
contents: read
66+
4867

4968
steps:
5069
- name: Download artifact from build job
@@ -59,16 +78,12 @@ jobs:
5978
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
6079
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
6180

62-
- name: 'Deploy to Azure Web App Slot'
81+
- name: 'Deploy to Azure Web App'
6382
id: deploy-to-webapp
6483
uses: azure/webapps-deploy@v3
6584
with:
66-
# Current: Using slots in a single web app
67-
app-name: 'streetsupport-platform-api'
68-
# Update to 'Production' || 'Staging' when configure additional environment
69-
slot-name: ${{ github.ref_name == 'main' && 'Production' || 'Production' }}
70-
71-
# Alternative: For separate web apps (uncomment and modify as needed)
72-
# app-name: ${{ github.ref_name == 'main' && 'streetsupport-platform-api' || 'streetsupport-platform-api-staging' }}
73-
# Remove or comment out slot-name when using separate apps
74-
package: .
85+
app-name: ${{ vars.AZURE_APP_NAME }}
86+
# To think about reverting this part
87+
package: release.zip
88+
startup-command: 'npm start'
89+
clean: true
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Test
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- staging
7+
- main
8+
9+
jobs:
10+
test:
11+
name: test
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: '24.x'
24+
cache: 'npm'
25+
26+
- name: Install dependencies
27+
run: npm install
28+
29+
- name: Run ESLint
30+
run: npm run lint
31+
32+
- name: Run tests
33+
run: npm run test

.gitignore

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
node_modules
5+
dist
6+
dist-ssr
7+
*.local
8+
9+
# production
10+
/build
11+
/app
12+
13+
# env files (can opt-in for committing if needed)
14+
.env*
15+
16+
# Editor directories and files
17+
.vscode/*
18+
!.vscode/extensions.json
19+
20+
# Logs
21+
logs
22+
*.log
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
pnpm-debug.log*
27+
lerna-debug.log*
28+
29+
# Windsurf configuration
30+
.windsurf

LICENSE

Lines changed: 0 additions & 21 deletions
This file was deleted.

README.md

Whitespace-only changes.

eslint.config.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import eslint from '@eslint/js';
2+
import tseslint from '@typescript-eslint/eslint-plugin';
3+
import tseslintParser from '@typescript-eslint/parser';
4+
import globals from 'globals';
5+
6+
export default [
7+
{
8+
ignores: ['dist/**', 'node_modules/**']
9+
},
10+
{
11+
files: ['src/**/*.{ts,tsx}'],
12+
languageOptions: {
13+
parser: tseslintParser,
14+
parserOptions: {
15+
ecmaVersion: 2020,
16+
sourceType: 'module',
17+
project: './tsconfig.json'
18+
},
19+
globals: {
20+
...globals.node
21+
}
22+
},
23+
plugins: {
24+
'@typescript-eslint': tseslint
25+
},
26+
rules: {
27+
...eslint.configs.recommended.rules,
28+
...tseslint.configs.recommended.rules,
29+
'indent': ['error', 2],
30+
'linebreak-style': 'off',
31+
'semi': ['error', 'always'],
32+
'@typescript-eslint/explicit-function-return-type': 'off',
33+
'@typescript-eslint/no-explicit-any': 'off',
34+
'@typescript-eslint/no-unused-vars': 'error',
35+
'@typescript-eslint/no-non-null-assertion': 'off'
36+
}
37+
}
38+
];

jest.config.cjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/** @type {import('jest').Config} */
2+
module.exports = {
3+
testEnvironment: 'node',
4+
roots: ['<rootDir>/tests'],
5+
testMatch: ['**/?(*.)+(spec|test).[jt]s?(x)'],
6+
};

0 commit comments

Comments
 (0)