From 685acc666dfcb6b38c09cf5015c7211be4e4fcf8 Mon Sep 17 00:00:00 2001 From: NoFate301 Date: Mon, 10 Jul 2023 14:16:58 -0400 Subject: [PATCH 1/4] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/main_nofate301.yml | 56 ++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/main_nofate301.yml diff --git a/.github/workflows/main_nofate301.yml b/.github/workflows/main_nofate301.yml new file mode 100644 index 000000000..e18954e2e --- /dev/null +++ b/.github/workflows/main_nofate301.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 - Nofate301 + +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: '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: 'Nofate301' + slot-name: 'Production' + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_1422088A17784B37A12E56AAA4BEA13F }} + package: . From 532e7c3684484a9520d2361998caff41678c962a Mon Sep 17 00:00:00 2001 From: NoFate301 Date: Mon, 10 Jul 2023 14:23:14 -0400 Subject: [PATCH 2/4] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/dev_nofate301(dev).yml | 56 ++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/dev_nofate301(dev).yml diff --git a/.github/workflows/dev_nofate301(dev).yml b/.github/workflows/dev_nofate301(dev).yml new file mode 100644 index 000000000..79915de20 --- /dev/null +++ b/.github/workflows/dev_nofate301(dev).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 - nofate301 + +on: + push: + branches: + - Dev + 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: 'Dev' + 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: 'nofate301' + slot-name: 'Dev' + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_8784737BAE054DF4A89BD7BA443F8CE7 }} + package: . From 2f1b71d3797f0f4c4385f70690671e2d63f8e7a6 Mon Sep 17 00:00:00 2001 From: NoFate301 Date: Mon, 10 Jul 2023 14:49:14 -0400 Subject: [PATCH 3/4] Trying to add my name in --- index.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 5116dc331..bb7ede8c2 100644 --- a/index.js +++ b/index.js @@ -55,7 +55,24 @@ const router = express.Router(); // Hello World for index page app.get('/', function (req, res) { - return res.send("Hello World!"); + //return res.send("Hello World!"); + function formatName(user) { + return user.firstName + ' ' + user.lastName; + } + + const user = { + firstName: 'John', + lastName: 'Tropiano' + }; + + const element = ( +

+ Hello, {formatName(user)}! +

+ ); + + const root = ReactDOM.createRoot(document.getElementById('root')); + return res.send({element}); }) app.get('/api', function (req, res) { From 03fb980bed8f1cc4d73f3564952261c07a18e6bb Mon Sep 17 00:00:00 2001 From: NoFate301 Date: Mon, 10 Jul 2023 14:59:52 -0400 Subject: [PATCH 4/4] revert --- index.js | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/index.js b/index.js index bb7ede8c2..5116dc331 100644 --- a/index.js +++ b/index.js @@ -55,24 +55,7 @@ const router = express.Router(); // Hello World for index page app.get('/', function (req, res) { - //return res.send("Hello World!"); - function formatName(user) { - return user.firstName + ' ' + user.lastName; - } - - const user = { - firstName: 'John', - lastName: 'Tropiano' - }; - - const element = ( -

- Hello, {formatName(user)}! -

- ); - - const root = ReactDOM.createRoot(document.getElementById('root')); - return res.send({element}); + return res.send("Hello World!"); }) app.get('/api', function (req, res) {