From 85f4dff5dfcf6c1712865c46f8475500ec3e8f65 Mon Sep 17 00:00:00 2001 From: Raphael Carubbi Neto Date: Thu, 13 Jan 2022 10:02:35 +0000 Subject: [PATCH 1/9] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6e51d47..764049f 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ (original version from a youtube video linked below) https://youtu.be/J42SZXS-_Qo -[![Build Status](https://travis-ci.org/joemccann/dillinger.svg?branch=master)](https://travis-ci.org/joemccann/dillinger) +[![Build Status](https://travis-ci.org/rcarubbi/ytb_snake_js.svg?branch=master)](https://travis-ci.org/rcarubbi/ytb_snake_js) Fatures: From 8adfcefc0b6590edaae31de0e9036e7008f48f8d Mon Sep 17 00:00:00 2001 From: Raphael Carubbi Neto Date: Sun, 1 Jan 2023 22:11:38 +0000 Subject: [PATCH 2/9] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 764049f..06d90c1 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,6 @@ (original version from a youtube video linked below) https://youtu.be/J42SZXS-_Qo -[![Build Status](https://travis-ci.org/rcarubbi/ytb_snake_js.svg?branch=master)](https://travis-ci.org/rcarubbi/ytb_snake_js) - Fatures: From df7a39de31e38c59cb770c4379d50d594c2b180a Mon Sep 17 00:00:00 2001 From: Raphael Carubbi Neto Date: Sun, 1 Jan 2023 23:06:34 +0000 Subject: [PATCH 3/9] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/main_carubbi-snake.yml | 56 ++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/main_carubbi-snake.yml diff --git a/.github/workflows/main_carubbi-snake.yml b/.github/workflows/main_carubbi-snake.yml new file mode 100644 index 0000000..428261f --- /dev/null +++ b/.github/workflows/main_carubbi-snake.yml @@ -0,0 +1,56 @@ +# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy +# More GitHub Actions for Azure: https://github.com/Azure/actions + +name: Build and deploy Node.js app to Azure Web App - carubbi-snake + +on: + 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: '16.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: 'carubbi-snake' + slot-name: 'Production' + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_891E36B2E7C64F769A7C76009AA41D42 }} + package: . From b94e92e9bcb73d1f51f1040aea8015ffe6543fa6 Mon Sep 17 00:00:00 2001 From: Raphael Carubbi Neto Date: Sun, 1 Jan 2023 23:15:09 +0000 Subject: [PATCH 4/9] Update main_carubbi-snake.yml --- .github/workflows/main_carubbi-snake.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main_carubbi-snake.yml b/.github/workflows/main_carubbi-snake.yml index 428261f..b8e85c0 100644 --- a/.github/workflows/main_carubbi-snake.yml +++ b/.github/workflows/main_carubbi-snake.yml @@ -24,8 +24,8 @@ jobs: - name: npm install, build, and test run: | npm install - npm run build --if-present - npm run test --if-present + npm start + - name: Upload artifact for deployment job uses: actions/upload-artifact@v2 From 8667ecc4c55fa336fd7f59794f1c033bb9ad070c Mon Sep 17 00:00:00 2001 From: Raphael Carubbi Neto Date: Sun, 1 Jan 2023 23:20:29 +0000 Subject: [PATCH 5/9] Update main_carubbi-snake.yml --- .github/workflows/main_carubbi-snake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main_carubbi-snake.yml b/.github/workflows/main_carubbi-snake.yml index b8e85c0..f1186bc 100644 --- a/.github/workflows/main_carubbi-snake.yml +++ b/.github/workflows/main_carubbi-snake.yml @@ -24,7 +24,7 @@ jobs: - name: npm install, build, and test run: | npm install - npm start + - name: Upload artifact for deployment job From 957335138c2ad3fd5fd11d40402eb83c167a6eed Mon Sep 17 00:00:00 2001 From: Raphael Carubbi Neto Date: Mon, 2 Jan 2023 00:10:10 +0000 Subject: [PATCH 6/9] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 06d90c1..ea37425 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Fatures: Live demo here: -https://carubbi-snake.herokuapp.com/frontend/snake.html +https://carubbi-snake.azurewebsites.net/frontend/snake.html ## Features From c6eca0ebf5d0cedc8e253be63ed9333c10535b70 Mon Sep 17 00:00:00 2001 From: Raphael Carubbi Neto Date: Mon, 2 Jan 2023 00:11:57 +0000 Subject: [PATCH 7/9] Update server.mjs --- multiplayer/backend/server.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multiplayer/backend/server.mjs b/multiplayer/backend/server.mjs index c049bbc..13a8bee 100644 --- a/multiplayer/backend/server.mjs +++ b/multiplayer/backend/server.mjs @@ -17,7 +17,7 @@ const port = process.env.PORT || 3000; // listen to port 3000 httpServer.listen(port, function () { // serve frontend game - app.use("/frontend", express.static(path.join(__dirname, '..', 'frontend'))); + app.use("/", express.static(path.join(__dirname, '..', 'frontend'))); app.use("/scripts", express.static(path.join(__dirname, '..', 'scripts'))); From 517f5bbe45f6147c073c1fbbc3fd83d4b64ee8ff Mon Sep 17 00:00:00 2001 From: Raphael Carubbi Neto Date: Mon, 2 Jan 2023 00:19:33 +0000 Subject: [PATCH 8/9] Update server.mjs --- multiplayer/backend/server.mjs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/multiplayer/backend/server.mjs b/multiplayer/backend/server.mjs index 13a8bee..92f93e3 100644 --- a/multiplayer/backend/server.mjs +++ b/multiplayer/backend/server.mjs @@ -13,11 +13,14 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url)); // select port according to environment const port = process.env.PORT || 3000; - +const options = { + index: "snake.html" +}; // listen to port 3000 httpServer.listen(port, function () { // serve frontend game - app.use("/", express.static(path.join(__dirname, '..', 'frontend'))); + + app.use("/", express.static(path.join(__dirname, '..', 'frontend'), options)); app.use("/scripts", express.static(path.join(__dirname, '..', 'scripts'))); From 6a406b72619433619f007fb198365b1fad81c99c Mon Sep 17 00:00:00 2001 From: Raphael Carubbi Neto Date: Mon, 2 Jan 2023 00:26:14 +0000 Subject: [PATCH 9/9] Update README.md --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index ea37425..a0189a5 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,7 @@ https://youtu.be/J42SZXS-_Qo Fatures: - -Live demo here: -https://carubbi-snake.azurewebsites.net/frontend/snake.html - +Live demo here: https://carubbi-snake.azurewebsites.net ## Features