Skip to content

Commit

Permalink
Merge pull request #56 from perttuvaarala/azuree
Browse files Browse the repository at this point in the history
Azuree
  • Loading branch information
perttuvaarala authored Oct 12, 2023
2 parents 26437f8 + 88470af commit 9f722fa
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 52 deletions.
105 changes: 57 additions & 48 deletions .github/workflows/main_catchmaster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,62 @@
name: Build and deploy Node.js app to Azure Web App - catchmaster

on:
push:
branches:
- main
workflow_dispatch:
push:
branches:
- main
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Node.js version
uses: actions/setup-node@v1
with:
node-version: '18.x'

- name: npm install, build, and test
run: |
npm install
npm run build --if-present
npm run test --if-present
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v2
with:
name: node-app
path: .

deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: 'Production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}

steps:
- name: Download artifact from build job
uses: actions/download-artifact@v2
with:
name: node-app

- name: 'Deploy to Azure Web App'
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: 'catchmaster'
slot-name: 'Production'
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_8C463144B4B943EC85F3BC2071BDF09C }}
package: .
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Node.js version
uses: actions/setup-node@v1
with:
node-version: "18.x"

- name: npm install, build, and test
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}
GOOGLE_CALLBACK_URL: ${{ secrets.GOOGLE_CALLBACK_URL }}
APP_URL: ${{ secrets.APP_URL }}
SESSION_SECRET: ${{ secrets.SESSION_SECRET }}
SESSION_COOKIE_NAME: ${{ secrets.SESSION_COOKIE_NAME }}
VITE_SERVER_URL: ${{ secrets.VITE_SERVER_URL }}
run: |
npm install -w server
npm run build
npm run start
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v2
with:
name: node-app
path: .

deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: "Production"
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}

steps:
- name: Download artifact from build job
uses: actions/download-artifact@v2
with:
name: node-app

- name: "Deploy to Azure Web App"
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: "catchmaster"
slot-name: "Production"
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_8C463144B4B943EC85F3BC2071BDF09C }}
package: .
4 changes: 3 additions & 1 deletion packages/app/src/components/Map/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ function Map() {
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
<Marker position={position} icon={redMarker}>
<Popup>You are here</Popup>
<Popup className=".leaflet-popup-content-wrapper">
<StyledMarkerPopup>You are here</StyledMarkerPopup>
</Popup>
</Marker>
{data.getAllPosts.map((post) => (
<Marker key={post.id} position={[post.lat, post.lon]}>
Expand Down
4 changes: 3 additions & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"main": "index.js",
"scripts": {
"dev": "cross-env NODE_ENV=development nodemon --exec ts-node src/index.ts",
"gen:schema": "graphql-codegen --config codegen.schema.yml"
"build": "tsc",
"gen:schema": "graphql-codegen --config codegen.schema.yml",
"start": "node dist/index.js"
},
"keywords": [],
"author": "",
Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/api/schema/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import path from "path";
import { loadFilesSync } from "@graphql-tools/load-files";
import { mergeTypeDefs } from "@graphql-tools/merge";

const typesArray = loadFilesSync(path.join(__dirname, "./**/*.graphql"));
const typesArray = loadFilesSync(path.join(__dirname, "./../../../**/*.graphql"));
const typeDefs = mergeTypeDefs(typesArray);

export default typeDefs;
1 change: 1 addition & 0 deletions packages/server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ const startServer = async () => {
const app = express();
const httpServer = http.createServer(app);


const server = new ApolloServer<TContext>({
typeDefs,
resolvers,
Expand Down
2 changes: 1 addition & 1 deletion packages/server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
// "outDir": "./", /* Specify an output folder for all emitted files. */
"outDir": "./dist", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
Expand Down

0 comments on commit 9f722fa

Please sign in to comment.