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 }} diff --git a/.github/workflows/assigned-pulls-todo.yml b/.github/workflows/assigned-pulls-todo.yml new file mode 100644 index 00000000..79e3c988 --- /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: Welcome + column: To Do + repo-token: ${{ secrets.GH_TOKEN }} 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 }} diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml new file mode 100644 index 00000000..7ab56746 --- /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.1001' + max_complex_functions_rate: '0.0001' + max_long_functions_rate: '0.0001' + project_name: '' + max_timeout_sec: '600' diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 00000000..9d8a0273 --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,59 @@ +# 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, 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 + - 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 diff --git a/.github/workflows/opened-issues-triage.yml b/.github/workflows/opened-issues-triage.yml new file mode 100644 index 00000000..d3fc8d5a --- /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: Welcome + column: Done + repo-token: ${{ secrets.GH_TOKEN }} diff --git a/README.md b/README.md index e02cd858..6baafbf0 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ ## 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.: +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) ![out](https://user-images.githubusercontent.com/1078545/57860397-bc7ff380-77ec-11e9-80f8-39e02ef3c035.gif) -### Demo (failure) +### Demo (failure)newfile ![out](https://user-images.githubusercontent.com/1078545/57860396-bc7ff380-77ec-11e9-8f55-83b879e667d2.gif)