From 2424770725e38c3ba4f55ed074c591bff24f0e1f Mon Sep 17 00:00:00 2001 From: Chris Jeffrey Date: Tue, 4 May 2021 16:25:52 +0100 Subject: [PATCH 01/11] Create node.js.yml --- .github/workflows/node.js.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 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..49fc6321 --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,27 @@ +# 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 ] +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [10.x, 12.x, 14.x, 15.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@v2 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci + - run: npm run build --if-present + - run: npm test From 3a68d30bccfd9ce47db13f05b9398ab0f3b32790 Mon Sep 17 00:00:00 2001 From: Chris Jeffrey Date: Tue, 4 May 2021 16:27:32 +0100 Subject: [PATCH 02/11] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e02cd858..80914217 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ ## Welcome +## We rule!!!!! 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. From dca8172adb0a9e57087f499a1bf5f05aa1c5d3ef Mon Sep 17 00:00:00 2001 From: andy-gore <64426235+andy-gore@users.noreply.github.com> Date: Tue, 4 May 2021 16:46:39 +0100 Subject: [PATCH 03/11] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 80914217..a61ba9a4 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ ## Welcome ## We rule!!!!! +## You shouldnt work 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. From d6e577a174d5c515cf98fa33b07709dd898b3259 Mon Sep 17 00:00:00 2001 From: Chris Jeffrey Date: Tue, 4 May 2021 16:48:27 +0100 Subject: [PATCH 04/11] Update node.js.yml --- .github/workflows/node.js.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 49fc6321..6fc5a5a7 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -6,6 +6,9 @@ name: Node.js CI on: push: branches: [ master ] + pull_request: + branches: [ master ] + jobs: build: From 728fce63aebfa5bb585cbfa626dde63e0a85ce45 Mon Sep 17 00:00:00 2001 From: Chris Jeffrey Date: Tue, 4 May 2021 17:09:51 +0100 Subject: [PATCH 05/11] 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..47f6533c 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("Word"), "Hello World 👋👋"); }); it("Throws on missing params", function() { From 4ca8cff47874be01d52e3e34da1242b999e6d708 Mon Sep 17 00:00:00 2001 From: andy-gore <64426235+andy-gore@users.noreply.github.com> Date: Tue, 4 May 2021 17:13:36 +0100 Subject: [PATCH 06/11] 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 47f6533c..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("Word"), "Hello World 👋👋"); + assert.equal(utils.greetings("World"), "Hello World 👋👋"); }); it("Throws on missing params", function() { From 768044a97663a333c2152c7f75ab346844288109 Mon Sep 17 00:00:00 2001 From: Chris Jeffrey Date: Tue, 4 May 2021 17:16:25 +0100 Subject: [PATCH 07/11] 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..47f6533c 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("Word"), "Hello World 👋👋"); }); it("Throws on missing params", function() { From 0ffd980104a13d8794d5268174bd875e212a4912 Mon Sep 17 00:00:00 2001 From: avikaushik Date: Tue, 4 May 2021 09:19:09 -0700 Subject: [PATCH 08/11] Update utils.test.js Updated World --- 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 47f6533c..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("Word"), "Hello World 👋👋"); + assert.equal(utils.greetings("World"), "Hello World 👋👋"); }); it("Throws on missing params", function() { From 79e68b2bb0d4bfbd811c2957c5ca890ff784c001 Mon Sep 17 00:00:00 2001 From: avikaushik Date: Tue, 4 May 2021 09:49:37 -0700 Subject: [PATCH 09/11] 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..47f6533c 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("Word"), "Hello World 👋👋"); }); it("Throws on missing params", function() { From dd3aa110c564dd93dfe5e63b0eea4d773f851c6d Mon Sep 17 00:00:00 2001 From: Chris Jeffrey Date: Tue, 4 May 2021 18:05:24 +0100 Subject: [PATCH 10/11] 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 47f6533c..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("Word"), "Hello World 👋👋"); + assert.equal(utils.greetings("World"), "Hello World 👋👋"); }); it("Throws on missing params", function() { From 1036569dd38987a6d6818e2fb6924a14c77a70ca Mon Sep 17 00:00:00 2001 From: Chris Jeffrey Date: Tue, 4 May 2021 18:30:21 +0100 Subject: [PATCH 11/11] Create azure.yml --- .github/workflows/azure.yml | 50 +++++++++++++++++++++++++++++++++++++ 1 file changed, 50 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..a7c36a20 --- /dev/null +++ b/.github/workflows/azure.yml @@ -0,0 +1,50 @@ +# This workflow will build and push a node.js application to an Azure Web App when a release is created. +# +# This workflow assumes you have already created the target Azure App Service web app. +# For instructions see https://docs.microsoft.com/azure/app-service/app-service-plan-manage#create-an-app-service-plan +# +# To configure this workflow: +# +# 1. For Linux apps, add an app setting called WEBSITE_WEBDEPLOY_USE_SCM and set it to true in your app **before downloading the file**. +# For more instructions see: https://docs.microsoft.com/azure/app-service/configure-common#configure-app-settings +# +# 2. Set up a secret in your repository named AZURE_WEBAPP_PUBLISH_PROFILE with the value of your Azure publish profile. +# For instructions on obtaining the publish profile see: https://docs.microsoft.com/azure/app-service/deploy-github-actions#configure-the-github-secret +# +# 3. Change the values for the AZURE_WEBAPP_NAME, AZURE_WEBAPP_PACKAGE_PATH and NODE_VERSION environment variables (below). +# +# For more information on GitHub Actions for Azure, refer to https://github.com/Azure/Actions +# For more samples to get started with GitHub Action workflows to deploy to Azure, refer to https://github.com/Azure/actions-workflow-samples +on: + release: + types: [created] + +env: + AZURE_WEBAPP_NAME: githubdemo # 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@v2 + 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: '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 }}