diff --git a/.github/workflows/azure.yml b/.github/workflows/azure.yml new file mode 100644 index 00000000..58423811 --- /dev/null +++ b/.github/workflows/azure.yml @@ -0,0 +1,49 @@ +# 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: your-app-name # 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: '10.x' # set this to the node version to use + +jobs: + build-and-deploy: + name: Build and Deploy + runs-on: ubuntu-latest + 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: '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 }} diff --git a/.github/workflows/master_github4(dev).yml b/.github/workflows/master_github4(dev).yml new file mode 100644 index 00000000..92b58035 --- /dev/null +++ b/.github/workflows/master_github4(dev).yml @@ -0,0 +1,35 @@ +# 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 Dev + +on: + pull_request: + branches: + - master + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@master + + - name: Set up Node.js version + uses: actions/setup-node@v1 + with: + node-version: '14.x' + + - name: npm install, build, and test + run: | + npm install + npm run build --if-present + npm run test --if-present + + - name: 'Deploy to Azure Web App' + uses: azure/webapps-deploy@v2 + with: + app-name: 'github4' + slot-name: 'dev' + publish-profile: ${{ secrets.AzureAppService_PublishProfile_d5b1dbab2209482bb34e21c5c829a1bf }} + package: . \ No newline at end of file diff --git a/.github/workflows/master_github4.yml b/.github/workflows/master_github4.yml new file mode 100644 index 00000000..b36e5498 --- /dev/null +++ b/.github/workflows/master_github4.yml @@ -0,0 +1,40 @@ +# 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 Product + +on: + pull_request: + branches: + - master + types: [closed] + +jobs: + job: + runs-on: ubuntu-latest + if: github.event.pull_request.merged == true + + build-and-deploy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@master + + - name: Set up Node.js version + uses: actions/setup-node@v1 + with: + node-version: '14.x' + + - name: npm install, build, and test + run: | + npm install + npm run build --if-present + npm run test --if-present + + - name: 'Deploy to Azure Web App' + uses: azure/webapps-deploy@v2 + with: + app-name: 'github4' + slot-name: 'production' + publish-profile: ${{ secrets.AzureAppService_PublishProfile_a797a18d20784f84a16d14870e6fd662 }} + package: . \ No newline at end of file diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 00000000..05a9a9c7 --- /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: [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@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci + - run: npm run build --if-present + - run: npm test diff --git a/.github/workflows/test-and-build.yml b/.github/workflows/test-and-build.yml new file mode 100644 index 00000000..e60c4b4d --- /dev/null +++ b/.github/workflows/test-and-build.yml @@ -0,0 +1,14 @@ +name: Node build and test + +on : [push] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - users: actions/checkout@v2 + - name: npm install and build + run: | + npm install + npm run build --if-present + npm test \ No newline at end of file diff --git a/README.md b/README.md index e02cd858..5e21ebaf 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ ## Welcome +## Hellow 2 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. diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..480f505f --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,24 @@ +# Security Policy + +## Supported Versions + +Use this section to tell people about which versions of your project are +currently being supported with security updates. + +| Version | Supported | +| ------- | ------------------ | +| 5.1.x | :white_check_mark: | +| 5.0.x | :x: | +| 4.0.x | :white_check_mark: | +| < 4.0 | :x: | + +## Reporting a Vulnerability + +Use this section to tell people how to report a vulnerability. + +Tell them where to go, how often they can expect to get an update on a +reported vulnerability, what to expect if the vulnerability is accepted or +declined, etc. + + +add XXX comment(policy test). diff --git a/test/utils.test.js b/test/utils.test.js index be1803c5..9107113c 100644 --- a/test/utils.test.js +++ b/test/utils.test.js @@ -11,8 +11,12 @@ var mochaAsync = fn => { describe("Utils", function() { describe("greetings", function() { - it("Says Hello World", function() { - assert.equal(utils.greetings("World"), "Hello World 👋👋"); + //it("Says Hello World", function () { + //assert.equal(utils.greetings("World"), "test"); + //}); + + it("Says Hello World", function () { + assert.equal(utils.greetings("World"), "Hello World 👋👋"); }); it("Throws on missing params", function() { diff --git a/views/index.pug b/views/index.pug index e7d469fe..b1897e5b 100644 --- a/views/index.pug +++ b/views/index.pug @@ -10,7 +10,7 @@ html a(href="#") Docs a(href="#") About main.wrap - h1 Hello 🌎! + h1 Hello 🌎! I love ramen hr p This is our Tonkotsu 🍜 NodeJS webapp. You can find instructions inside the repository. pre #{zen.msg}