From 88fcd4100d00b9d18fc9b857e31dac34153e0b20 Mon Sep 17 00:00:00 2001 From: Anurenjini78 <78848039+Anurenjini78@users.noreply.github.com> Date: Mon, 29 Mar 2021 09:49:30 +0530 Subject: [PATCH 01/24] Create node.js.yml --- .github/workflows/node.js.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/node.js.yml diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 00000000..acc4c436 --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,30 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Node.js CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [ 12.x, 14.x ] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci + - run: npm run build --if-present + - run: npm test From a95347cc8bd300376c0a56b06d45d62be0fd8e58 Mon Sep 17 00:00:00 2001 From: Anurenjini78 <78848039+Anurenjini78@users.noreply.github.com> Date: Mon, 29 Mar 2021 09:50:40 +0530 Subject: [PATCH 02/24] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e02cd858..9de0b6b4 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ This is the NodeJS version of our "Tonkotsu" workshop webapp. The codebase is pr ![out](https://user-images.githubusercontent.com/1078545/57860397-bc7ff380-77ec-11e9-80f8-39e02ef3c035.gif) -### Demo (failure) +### Demo (failure)new ![out](https://user-images.githubusercontent.com/1078545/57860396-bc7ff380-77ec-11e9-8f55-83b879e667d2.gif) From 2052190faf13c151d83c60b426ffef2ad8d83576 Mon Sep 17 00:00:00 2001 From: Anurenjini78 <78848039+Anurenjini78@users.noreply.github.com> Date: Mon, 29 Mar 2021 09:56:54 +0530 Subject: [PATCH 03/24] Update node.js.yml --- .github/workflows/node.js.yml | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index acc4c436..80914d9d 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -27,4 +27,33 @@ jobs: node-version: ${{ matrix.node-version }} - run: npm ci - run: npm run build --if-present - - run: npm test + - uses: actions/upload-artifact@main + with: + name: artifacts + path: | + lib/ + test/ + views/ + package.json + index.js + test: + runs-on: ubuntu-latest + strategy: + matrix: + os: [ubuntu-latest] + node-version: [14.x] + needs: build + steps: + - uses: actions/checkout@v2 + - uses: actions/download-artifact@main + with: + name: artifacts + path: artifacts + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: npm install, and test + run: | + npm install + npm test From 2d36f1b12f33cf590a41a4955fa9c97cbea8e6be Mon Sep 17 00:00:00 2001 From: Anurenjini78 <78848039+Anurenjini78@users.noreply.github.com> Date: Mon, 29 Mar 2021 10:07:18 +0530 Subject: [PATCH 04/24] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9de0b6b4..700f1884 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ## Welcome -This repository contains the base project part of our on-site GitHub Verified Partner workshop program. It is meant to be used for in-classroom training under the supervision of GitHub coaches. +This repository contains the base project part of our on-site GitHub Verified Partner workshop program. It is meant to be used for in-classroom training under the supervision of GitHub coachess. This is the NodeJS version of our "Tonkotsu" workshop webapp. The codebase is pretty simple: it's a NodeJS app that will connect to GitHub's [Octocat API endpoint](https://api.github.com/octocat) and return the Zen quote of the day. E.g.: From bb21b9c65bcdd09b2b621fa54c5fd127bce82bd6 Mon Sep 17 00:00:00 2001 From: Anurenjini78 <78848039+Anurenjini78@users.noreply.github.com> Date: Mon, 29 Mar 2021 10:09:22 +0530 Subject: [PATCH 05/24] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 700f1884..9de0b6b4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ## Welcome -This repository contains the base project part of our on-site GitHub Verified Partner workshop program. It is meant to be used for in-classroom training under the supervision of GitHub coachess. +This repository contains the base project part of our on-site GitHub Verified Partner workshop program. It is meant to be used for in-classroom training under the supervision of GitHub coaches. This is the NodeJS version of our "Tonkotsu" workshop webapp. The codebase is pretty simple: it's a NodeJS app that will connect to GitHub's [Octocat API endpoint](https://api.github.com/octocat) and return the Zen quote of the day. E.g.: From 42f0c67f4c15804f79205777cc2f5c115db4e924 Mon Sep 17 00:00:00 2001 From: Anurenjini78 <78848039+Anurenjini78@users.noreply.github.com> Date: Mon, 29 Mar 2021 10:10:49 +0530 Subject: [PATCH 06/24] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9de0b6b4..700f1884 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ## Welcome -This repository contains the base project part of our on-site GitHub Verified Partner workshop program. It is meant to be used for in-classroom training under the supervision of GitHub coaches. +This repository contains the base project part of our on-site GitHub Verified Partner workshop program. It is meant to be used for in-classroom training under the supervision of GitHub coachess. This is the NodeJS version of our "Tonkotsu" workshop webapp. The codebase is pretty simple: it's a NodeJS app that will connect to GitHub's [Octocat API endpoint](https://api.github.com/octocat) and return the Zen quote of the day. E.g.: From cc69a39d7dcace387a85b96a039333e5969c86b3 Mon Sep 17 00:00:00 2001 From: AravindaSB <79310072+AravindaSB@users.noreply.github.com> Date: Mon, 29 Mar 2021 10:13:06 +0530 Subject: [PATCH 07/24] Update node.js.yml --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 80914d9d..9d8a0273 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: - node-version: [ 12.x, 14.x ] + node-version: [ 12.x, 14.x, 15.x ] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: From ebb44454b49d3e9a29e3da8e90a632852e7f6e81 Mon Sep 17 00:00:00 2001 From: Anurenjini78 <78848039+Anurenjini78@users.noreply.github.com> Date: Mon, 29 Mar 2021 10:13:43 +0530 Subject: [PATCH 08/24] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 700f1884..33e25922 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ This is the NodeJS version of our "Tonkotsu" workshop webapp. The codebase is pr ![out](https://user-images.githubusercontent.com/1078545/57860397-bc7ff380-77ec-11e9-80f8-39e02ef3c035.gif) -### Demo (failure)new +### Demo (failure)newfile ![out](https://user-images.githubusercontent.com/1078545/57860396-bc7ff380-77ec-11e9-8f55-83b879e667d2.gif) From dea2353197afb012b481d995124b95f038a8448e Mon Sep 17 00:00:00 2001 From: Anurenjini78 <78848039+Anurenjini78@users.noreply.github.com> Date: Mon, 29 Mar 2021 10:17:16 +0530 Subject: [PATCH 09/24] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 33e25922..6baafbf0 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ This repository contains the base project part of our on-site GitHub Verified Partner workshop program. It is meant to be used for in-classroom training under the supervision of GitHub coachess. -This is the NodeJS version of our "Tonkotsu" workshop webapp. The codebase is pretty simple: it's a NodeJS app that will connect to GitHub's [Octocat API endpoint](https://api.github.com/octocat) and return the Zen quote of the day. E.g.: +This is the NodeJS version of our "Tonkotsu" workshopp webapp. The codebase is pretty simple: it's a NodeJS app that will connect to GitHub's [Octocat API endpoint](https://api.github.com/octocat) and return the Zen quote of the day. E.g.: ### Demo (sucess) From 6ce82eb602ebd77647a8ffa81c5088f4d6a30430 Mon Sep 17 00:00:00 2001 From: Anurenjini78 <78848039+Anurenjini78@users.noreply.github.com> Date: Mon, 29 Mar 2021 10:33:12 +0530 Subject: [PATCH 10/24] Create code-quality.yml --- .github/workflows/code-quality.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/code-quality.yml diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml new file mode 100644 index 00000000..5c8f4de0 --- /dev/null +++ b/.github/workflows/code-quality.yml @@ -0,0 +1,21 @@ +on: [push] + +jobs: + check-quality: + runs-on: ubuntu-latest + name: A job to check my code quality + steps: + - name: Check code meets quality standards + id: code-inspector + uses: codeinspectorio/github-action@master + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + code_inspector_access_key: ${{ secrets.CODE_INSPECTOR_ACCESS_KEY }} + code_inspector_secret_key: ${{ secrets.CODE_INSPECTOR_SECRET_KEY }} + min_quality_grade: 'WARNING' + min_quality_score: '50' + max_defects_rate: '0.0001' + max_complex_functions_rate: '0.0001' + max_long_functions_rate: '0.0001' + project_name: '' + max_timeout_sec: '600' From 1277f5f1ffddc2dee92d4e315018614ad20912eb Mon Sep 17 00:00:00 2001 From: Anurenjini78 <78848039+Anurenjini78@users.noreply.github.com> Date: Mon, 29 Mar 2021 10:34:24 +0530 Subject: [PATCH 11/24] Update code-quality.yml --- .github/workflows/code-quality.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 5c8f4de0..7ab56746 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -14,7 +14,7 @@ jobs: code_inspector_secret_key: ${{ secrets.CODE_INSPECTOR_SECRET_KEY }} min_quality_grade: 'WARNING' min_quality_score: '50' - max_defects_rate: '0.0001' + max_defects_rate: '0.1001' max_complex_functions_rate: '0.0001' max_long_functions_rate: '0.0001' project_name: '' From 8df1c950c8152a97fecb537eea0e62ed08782e45 Mon Sep 17 00:00:00 2001 From: Anurenjini78 <78848039+Anurenjini78@users.noreply.github.com> Date: Mon, 29 Mar 2021 10:35:55 +0530 Subject: [PATCH 12/24] Update utils.test.js --- test/utils.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/utils.test.js b/test/utils.test.js index be1803c5..0f429044 100644 --- a/test/utils.test.js +++ b/test/utils.test.js @@ -12,7 +12,7 @@ var mochaAsync = fn => { describe("Utils", function() { describe("greetings", function() { it("Says Hello World", function() { - assert.equal(utils.greetings("World"), "Hello World 👋👋"); + assert.equal(utils.greetings("Human"), "Hello World 👋👋"); }); it("Throws on missing params", function() { From 9869540a7c7ea77dc0207f325f8f673d1bdfc033 Mon Sep 17 00:00:00 2001 From: Anurenjini78 <78848039+Anurenjini78@users.noreply.github.com> Date: Mon, 29 Mar 2021 10:41:48 +0530 Subject: [PATCH 13/24] Update utils.test.js --- test/utils.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/utils.test.js b/test/utils.test.js index 0f429044..be1803c5 100644 --- a/test/utils.test.js +++ b/test/utils.test.js @@ -12,7 +12,7 @@ var mochaAsync = fn => { describe("Utils", function() { describe("greetings", function() { it("Says Hello World", function() { - assert.equal(utils.greetings("Human"), "Hello World 👋👋"); + assert.equal(utils.greetings("World"), "Hello World 👋👋"); }); it("Throws on missing params", function() { From fca0ae27f90167ad4218a02805b774416fc438a2 Mon Sep 17 00:00:00 2001 From: Anurenjini78 <78848039+Anurenjini78@users.noreply.github.com> Date: Mon, 29 Mar 2021 10:48:22 +0530 Subject: [PATCH 14/24] Update utils.test.js --- test/utils.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/utils.test.js b/test/utils.test.js index be1803c5..0f429044 100644 --- a/test/utils.test.js +++ b/test/utils.test.js @@ -12,7 +12,7 @@ var mochaAsync = fn => { describe("Utils", function() { describe("greetings", function() { it("Says Hello World", function() { - assert.equal(utils.greetings("World"), "Hello World 👋👋"); + assert.equal(utils.greetings("Human"), "Hello World 👋👋"); }); it("Throws on missing params", function() { From 364342b9e477636bfffcea6e22b255f073510582 Mon Sep 17 00:00:00 2001 From: Anurenjini78 <78848039+Anurenjini78@users.noreply.github.com> Date: Mon, 29 Mar 2021 10:55:36 +0530 Subject: [PATCH 15/24] Update utils.test.js --- test/utils.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/utils.test.js b/test/utils.test.js index 0f429044..be1803c5 100644 --- a/test/utils.test.js +++ b/test/utils.test.js @@ -12,7 +12,7 @@ var mochaAsync = fn => { describe("Utils", function() { describe("greetings", function() { it("Says Hello World", function() { - assert.equal(utils.greetings("Human"), "Hello World 👋👋"); + assert.equal(utils.greetings("World"), "Hello World 👋👋"); }); it("Throws on missing params", function() { From 60e1ac8d56e3690bea6d1abee6b804d365a25058 Mon Sep 17 00:00:00 2001 From: AravindaSB <79310072+AravindaSB@users.noreply.github.com> Date: Mon, 29 Mar 2021 10:57:44 +0530 Subject: [PATCH 16/24] Create opened-issues-triage.yml --- .github/workflows/opened-issues-triage.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/opened-issues-triage.yml diff --git a/.github/workflows/opened-issues-triage.yml b/.github/workflows/opened-issues-triage.yml new file mode 100644 index 00000000..e93ab0cf --- /dev/null +++ b/.github/workflows/opened-issues-triage.yml @@ -0,0 +1,15 @@ +name: Move new issues into Triage + +on: + issues: + types: [opened] + +jobs: + automate-project-columns: + runs-on: ubuntu-latest + steps: + - uses: alex-page/github-project-automation-plus@v0.3.0 + with: + project: Backlog + column: Triage + repo-token: ${{ secrets.GITHUB_TOKEN }} From 17f51b7c79165aebc69f7408b3c3e862c5826508 Mon Sep 17 00:00:00 2001 From: AravindaSB <79310072+AravindaSB@users.noreply.github.com> Date: Mon, 29 Mar 2021 10:58:15 +0530 Subject: [PATCH 17/24] Create assigned-pulls-todo.yml --- .github/workflows/assigned-pulls-todo.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/assigned-pulls-todo.yml diff --git a/.github/workflows/assigned-pulls-todo.yml b/.github/workflows/assigned-pulls-todo.yml new file mode 100644 index 00000000..7b93cfc2 --- /dev/null +++ b/.github/workflows/assigned-pulls-todo.yml @@ -0,0 +1,15 @@ +name: Move assigned pull requests into To do + +on: + pull_request: + types: [assigned] + +jobs: + automate-project-columns: + runs-on: ubuntu-latest + steps: + - uses: alex-page/github-project-automation-plus@v0.3.0 + with: + project: Backlog + column: To do + repo-token: ${{ secrets.GITHUB_TOKEN }} From 6dcf39c80a49314c1871e5e61d34492c389d2473 Mon Sep 17 00:00:00 2001 From: AravindaSB <79310072+AravindaSB@users.noreply.github.com> Date: Mon, 29 Mar 2021 11:08:02 +0530 Subject: [PATCH 18/24] Update opened-issues-triage.yml --- .github/workflows/opened-issues-triage.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/opened-issues-triage.yml b/.github/workflows/opened-issues-triage.yml index e93ab0cf..5a8fc6b1 100644 --- a/.github/workflows/opened-issues-triage.yml +++ b/.github/workflows/opened-issues-triage.yml @@ -10,6 +10,6 @@ jobs: steps: - uses: alex-page/github-project-automation-plus@v0.3.0 with: - project: Backlog - column: Triage - repo-token: ${{ secrets.GITHUB_TOKEN }} + project: Welcome + column: To Do + repo-token: ${{ secrets.GH_TOKEN }} From 8ee486074c1afb7c9c32c9b0e5e0cb14e7ede8a7 Mon Sep 17 00:00:00 2001 From: AravindaSB <79310072+AravindaSB@users.noreply.github.com> Date: Mon, 29 Mar 2021 11:08:48 +0530 Subject: [PATCH 19/24] Update assigned-pulls-todo.yml --- .github/workflows/assigned-pulls-todo.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/assigned-pulls-todo.yml b/.github/workflows/assigned-pulls-todo.yml index 7b93cfc2..0940d642 100644 --- a/.github/workflows/assigned-pulls-todo.yml +++ b/.github/workflows/assigned-pulls-todo.yml @@ -10,6 +10,6 @@ jobs: steps: - uses: alex-page/github-project-automation-plus@v0.3.0 with: - project: Backlog - column: To do - repo-token: ${{ secrets.GITHUB_TOKEN }} + project: Welcome + column: Done + repo-token: ${{ secrets.GH_TOKEN }} From ac9be85d59a3e0ba05c20b25b9b475dcf69fca82 Mon Sep 17 00:00:00 2001 From: Anurenjini78 <78848039+Anurenjini78@users.noreply.github.com> Date: Mon, 29 Mar 2021 11:16:03 +0530 Subject: [PATCH 20/24] Update opened-issues-triage.yml --- .github/workflows/opened-issues-triage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/opened-issues-triage.yml b/.github/workflows/opened-issues-triage.yml index 5a8fc6b1..d3fc8d5a 100644 --- a/.github/workflows/opened-issues-triage.yml +++ b/.github/workflows/opened-issues-triage.yml @@ -11,5 +11,5 @@ jobs: - uses: alex-page/github-project-automation-plus@v0.3.0 with: project: Welcome - column: To Do + column: Done repo-token: ${{ secrets.GH_TOKEN }} From 48c40fb9380f5f9aa527596c2ac3cba758fc56e2 Mon Sep 17 00:00:00 2001 From: Anurenjini78 <78848039+Anurenjini78@users.noreply.github.com> Date: Mon, 29 Mar 2021 11:17:31 +0530 Subject: [PATCH 21/24] Update opened-issues-triage.yml From a9fadd58fd38c948cb24178da53edf0e5b251bd2 Mon Sep 17 00:00:00 2001 From: Anurenjini78 <78848039+Anurenjini78@users.noreply.github.com> Date: Mon, 29 Mar 2021 11:18:24 +0530 Subject: [PATCH 22/24] Update assigned-pulls-todo.yml --- .github/workflows/assigned-pulls-todo.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/assigned-pulls-todo.yml b/.github/workflows/assigned-pulls-todo.yml index 0940d642..79e3c988 100644 --- a/.github/workflows/assigned-pulls-todo.yml +++ b/.github/workflows/assigned-pulls-todo.yml @@ -10,6 +10,6 @@ jobs: steps: - uses: alex-page/github-project-automation-plus@v0.3.0 with: - project: Welcome - column: Done + project: Welcome + column: To Do repo-token: ${{ secrets.GH_TOKEN }} From f03b766d1d8f0bf8cb79f4e51b8a9a927bf0c429 Mon Sep 17 00:00:00 2001 From: Anurenjini78 <78848039+Anurenjini78@users.noreply.github.com> Date: Mon, 29 Mar 2021 11:32:43 +0530 Subject: [PATCH 23/24] Create azure.yml --- .github/workflows/azure.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/azure.yml diff --git a/.github/workflows/azure.yml b/.github/workflows/azure.yml new file mode 100644 index 00000000..e22a9e30 --- /dev/null +++ b/.github/workflows/azure.yml @@ -0,0 +1,37 @@ +on: + pull_request: + types: [ opened ] + +env: + AZURE_WEBAPP_NAME: Githubazure # set this to your application's name + AZURE_WEBAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root + NODE_VERSION: '14.x' # set this to the node version to use + +jobs: + build-and-deploy: + name: Build and Deploy + runs-on: ubuntu-latest + environment: staging + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: npm install, build, and test + run: | + # Build and test the project, then + # deploy to Azure Web App. + npm install + npm run build --if-present + npm run test --if-present + - name: 'Login via Azure CLI' + uses: azure/login@v1 + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + - name: 'Deploy to Azure WebApp' + uses: azure/webapps-deploy@v2 + with: + app-name: ${{ env.AZURE_WEBAPP_NAME }} + publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} + package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} From f68727067824b52c6991452a73e136165192a8fc Mon Sep 17 00:00:00 2001 From: Anurenjini78 <78848039+Anurenjini78@users.noreply.github.com> Date: Mon, 29 Mar 2021 11:53:26 +0530 Subject: [PATCH 24/24] Create Production.yml --- .github/workflows/Production.yml | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/Production.yml diff --git a/.github/workflows/Production.yml b/.github/workflows/Production.yml new file mode 100644 index 00000000..230c4d5f --- /dev/null +++ b/.github/workflows/Production.yml @@ -0,0 +1,38 @@ +on: + pull_request: + types: [ closed ] + branches: [ master ] + +env: + AZURE_WEBAPP_NAME: Prodgithub # set this to your application's name + AZURE_WEBAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root + NODE_VERSION: '14.x' # set this to the node version to use + +jobs: + build-and-deploy: + name: Build and Deploy + runs-on: ubuntu-latest + environment: production + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: npm install, build, and test + run: | + # Build and test the project, then + # deploy to Azure Web App. + npm install + npm run build --if-present + npm run test --if-present + - name: 'Login via Azure CLI' + uses: azure/login@v1 + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + - name: 'Deploy to Azure WebApp' + uses: azure/webapps-deploy@v2 + with: + app-name: ${{ env.AZURE_WEBAPP_NAME }} + publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} + package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}