Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: deploy to scalingo #6

Merged
merged 6 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
jobs:
ci:
name: CI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'yarn'
- name: Install dependencies
run: yarn
- name: Lint the codebase
run: yarn lint
- name: Build
run: yarn build
41 changes: 0 additions & 41 deletions .github/workflows/deploy.yml

This file was deleted.

14 changes: 0 additions & 14 deletions .github/workflows/scan.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: Scan
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
jobs:
Expand All @@ -18,14 +15,3 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# scan:
# name: gitleaks
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# with:
# fetch-depth: 0
# - uses: gitleaks/gitleaks-action@v2
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# GITLEAKS_LICENSE: ${{secrets.BAL_GITLEAKS_LICENSE}}
19 changes: 12 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"@types/node": "^16.7.13",
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"express": "^4.19.2",
"friendly-challenge": "^0.9.16",
"maplibre-gl": "^4.3.2",
"react": "^18.3.1",
Expand All @@ -24,11 +25,14 @@
"web-vitals": "^2.1.0"
},
"scripts": {
"start": "react-scripts start",
"start": "node server.js",
"dev": "react-scripts start",
"lint": "eslint src",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"generate:openapi:signalement": "openapi --input http://localhost:5005/api-json --output ./src/api/signalement"
"generate:openapi:signalement": "openapi --input http://localhost:5005/api-json --output ./src/api/signalement",
"push-staging": "./scripts/push-staging.sh"
},
"eslintConfig": {
"extends": [
Expand All @@ -49,14 +53,15 @@
]
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@babel/plugin-transform-private-property-in-object": "^7.24.7",
"@typescript-eslint/eslint-plugin": "^7.13.0",
"@typescript-eslint/parser": "^7.13.0",
"eslint": "^9.4.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.34.2",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint": "^8.54.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"openapi-typescript-codegen": "^0.29.0",
"prettier": "^3.3.2"
}
Expand Down
6 changes: 6 additions & 0 deletions scripts/push-staging.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
current_branch=$(git symbolic-ref --short HEAD)
git checkout staging
git reset --hard $current_branch
git push -f origin staging
git checkout $current_branch
11 changes: 11 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const express = require('express');

const app = express();
const directory = '/' + (process.env.STATIC_DIR || 'build')
console.log(__dirname + directory)
app.use(express.static(__dirname + directory));

const port = process.env.PORT || 3004;
app.listen(port, function () {
console.log('Listening on', port);
});
Loading
Loading