From 5b5ffd874b1ac2100a5d79cfab14e0802a8be9ba Mon Sep 17 00:00:00 2001 From: Fredrick Kelly <38326256+iamfredrickokereke@users.noreply.github.com> Date: Sun, 7 Mar 2021 12:57:52 +0100 Subject: [PATCH 01/25] Create backend.yml --- .github/workflows/backend.yml | 54 +++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/backend.yml diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml new file mode 100644 index 00000000..fe835e03 --- /dev/null +++ b/.github/workflows/backend.yml @@ -0,0 +1,54 @@ +name: CI/CD Pipeline for Azure webapp deployment +'on': + push: + branches: + - master + pull_request: + types: + - synchronize + - closed + branches: + - master +jobs: + build: + if: >- + github.event_name == 'push' || (github.event_name == 'pull_request' && + github.event.action != 'closed') + runs-on: ubuntu-latest + name: Building Job + steps: + - uses: actions/checkout@v2 + - run: | + echo Job built successfully + + + deploy: + name: Deploying to Azure server + runs-on: ubuntu-latest + steps: + - name: Setup Node x version + uses: actions/setup-node@v1 + with: + node-version: '10.x, 11.x, 12.x, 13.x, 14.x' + - name: 'npm install, build, and test' + run: | + sudo pwd && ls + cd API/ + npm install + npm run build --if-present + npm run test --if-present + - name: Run Azure webapp deploy action using publish profile credentials + uses: azure/webapps-deploy@v2 + with: + app-name: node-rn + publish-profile: '${{ secrets.azureWebAppPublishProfile }}' + env: + SECRET_NAME: '${{secrets.GITHUB_CREDENTIAL_NAME}}' + SECRET_PASSWORD: '${{secrets.GITHUB_CREDENTIAL_PASSWORD}}' + if: github.ref == 'refs/heads/master' && job.status == 'success' + run: | + git remote add [repo link] + git push -u origin HEAD:master -f + + + From 1f0a03c0b3c54e441a8f9a86207921cc3c25f12c Mon Sep 17 00:00:00 2001 From: Fredrick Kelly <38326256+iamfredrickokereke@users.noreply.github.com> Date: Mon, 8 Mar 2021 01:25:02 +0100 Subject: [PATCH 02/25] 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..40792378 --- /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: 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 + 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: '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 89f1215cb6d2a973165ed3e866622742e76fd7bb Mon Sep 17 00:00:00 2001 From: Fredrick Kelly <38326256+iamfredrickokereke@users.noreply.github.com> Date: Mon, 8 Mar 2021 01:52:56 +0100 Subject: [PATCH 03/25] Update backend.yml --- .github/workflows/backend.yml | 53 ----------------------------------- 1 file changed, 53 deletions(-) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index fe835e03..8b137891 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -1,54 +1 @@ -name: CI/CD Pipeline for Azure webapp deployment -'on': - push: - branches: - - master - pull_request: - types: - - synchronize - - closed - branches: - - master -jobs: - build: - if: >- - github.event_name == 'push' || (github.event_name == 'pull_request' && - github.event.action != 'closed') - runs-on: ubuntu-latest - name: Building Job - steps: - - uses: actions/checkout@v2 - - run: | - echo Job built successfully - - deploy: - name: Deploying to Azure server - runs-on: ubuntu-latest - steps: - - name: Setup Node x version - uses: actions/setup-node@v1 - with: - node-version: '10.x, 11.x, 12.x, 13.x, 14.x' - - name: 'npm install, build, and test' - run: | - sudo pwd && ls - cd API/ - npm install - npm run build --if-present - npm run test --if-present - - name: Run Azure webapp deploy action using publish profile credentials - uses: azure/webapps-deploy@v2 - with: - app-name: node-rn - publish-profile: '${{ secrets.azureWebAppPublishProfile }}' - env: - SECRET_NAME: '${{secrets.GITHUB_CREDENTIAL_NAME}}' - SECRET_PASSWORD: '${{secrets.GITHUB_CREDENTIAL_PASSWORD}}' - if: github.ref == 'refs/heads/master' && job.status == 'success' - run: | - git remote add [repo link] - git push -u origin HEAD:master -f - - - From 0bcef7cdc0cae6fdf9c8e0ff554e307c5d9f18a0 Mon Sep 17 00:00:00 2001 From: Fredrick Kelly <38326256+iamfredrickokereke@users.noreply.github.com> Date: Mon, 8 Mar 2021 01:55:15 +0100 Subject: [PATCH 04/25] improved ci with actions --- .github/workflows/backend.yml | 48 +++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index 8b137891..a81c0e92 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -1 +1,49 @@ +# This is a basic workflow to help deploy my app to Azure +name: "CI/CD Pipeline for Azure webapp deployment" +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the master branch + push: + branches: + - master + pull_request: + types: [opened, synchronize, reopened, closed] + branches: + - master +env: + AZURE_WEBAPP_NAME: your-app-name # Azure server name + AZURE_WEBAPP_PACKAGE_PATH: "." # azure app path + +jobs: + build-and-deploy: + name: Build test and Deploy Node App to Azure + runs-on: ubuntu-latest + if: >- + github.event_name == 'push' || (github.event_name == 'pull_request' && + github.event.action != 'closed') + environment: production + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v1 + with: + node-version: "10.x, 11.x, 12.x, 13.x, 14.x" + - name: npm install, build, and test + run: | + pwd + ls + cd API/ + npm install + npm run build --if-present + npm run test --if-present + echo Successful + - name: "Deploy to Azure" + 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 }} + - if: github.ref == 'refs/heads/master' && job.status == 'success' + run: | + git push -u origin HEAD:master -f From 7ad22c5e06d05e88b49a996198ec885354f64469 Mon Sep 17 00:00:00 2001 From: Kelly online Date: Tue, 9 Mar 2021 09:06:15 +0100 Subject: [PATCH 05/25] improved comment --- .github/workflows/azure.yml | 50 ----------------------------------- .github/workflows/backend.yml | 11 +++++--- 2 files changed, 7 insertions(+), 54 deletions(-) delete mode 100644 .github/workflows/azure.yml diff --git a/.github/workflows/azure.yml b/.github/workflows/azure.yml deleted file mode 100644 index 40792378..00000000 --- a/.github/workflows/azure.yml +++ /dev/null @@ -1,50 +0,0 @@ -# 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 - 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: '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/backend.yml b/.github/workflows/backend.yml index a81c0e92..969fa7ed 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -1,9 +1,12 @@ -# This is a basic workflow to help deploy my app to Azure +# This is a basic workflow to help deploy the backend code to Azure server +# it triggers on push and pull request events to the master branch +# it runs the jobs on the API/ directory and deploys using secret credentials +# Update the secret credentials with details from the Azure web server. + name: "CI/CD Pipeline for Azure webapp deployment" # Controls when the action will run. on: - # Triggers the workflow on push or pull request events but only for the master branch push: branches: - master @@ -16,7 +19,7 @@ env: AZURE_WEBAPP_PACKAGE_PATH: "." # azure app path jobs: - build-and-deploy: + build_and_deploy: name: Build test and Deploy Node App to Azure runs-on: ubuntu-latest if: >- @@ -46,4 +49,4 @@ jobs: package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} - if: github.ref == 'refs/heads/master' && job.status == 'success' run: | - git push -u origin HEAD:master -f + git push -u origin HEAD:master -f From e8d491cce8f5d10a386dc5d1d413333cfdbf6ca9 Mon Sep 17 00:00:00 2001 From: Kelly online Date: Tue, 9 Mar 2021 09:29:48 +0100 Subject: [PATCH 06/25] improved the action and comment description --- .github/workflows/backend.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index 969fa7ed..dce6f46f 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -5,7 +5,6 @@ name: "CI/CD Pipeline for Azure webapp deployment" -# Controls when the action will run. on: push: branches: From 9c17a85b11af3214b3682616c092db7cb819f6de Mon Sep 17 00:00:00 2001 From: Kelly online Date: Mon, 7 Jun 2021 23:12:10 +0100 Subject: [PATCH 07/25] updated secrets and node version --- .github/workflows/backend.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index dce6f46f..0354a043 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -30,7 +30,7 @@ jobs: - name: Use Node.js ${{ env.NODE_VERSION }} uses: actions/setup-node@v1 with: - node-version: "10.x, 11.x, 12.x, 13.x, 14.x" + node-version: "14.x" - name: npm install, build, and test run: | pwd @@ -43,9 +43,9 @@ jobs: - name: "Deploy to Azure" uses: azure/webapps-deploy@v2 with: - app-name: ${{ env.AZURE_WEBAPP_NAME }} + app-name: ${{ secrets.AZURE_WEBAPP_NAME }} publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} - package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} + package: ${{ secrets.AZURE_WEBAPP_PACKAGE_PATH }} - if: github.ref == 'refs/heads/master' && job.status == 'success' run: | git push -u origin HEAD:master -f From 1111eb2a078fa29e30ad3b6342690ce9992cce9f Mon Sep 17 00:00:00 2001 From: Kelly online Date: Mon, 7 Jun 2021 23:52:41 +0100 Subject: [PATCH 08/25] removed declared env variable --- .github/workflows/backend.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index 0354a043..7afaa02e 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -13,10 +13,6 @@ on: types: [opened, synchronize, reopened, closed] branches: - master -env: - AZURE_WEBAPP_NAME: your-app-name # Azure server name - AZURE_WEBAPP_PACKAGE_PATH: "." # azure app path - jobs: build_and_deploy: name: Build test and Deploy Node App to Azure @@ -27,7 +23,7 @@ jobs: environment: production steps: - uses: actions/checkout@v2 - - name: Use Node.js ${{ env.NODE_VERSION }} + - name: Use Node.js uses: actions/setup-node@v1 with: node-version: "14.x" From 573edbc5a209a8d6e0333c8742332b567b4db08a Mon Sep 17 00:00:00 2001 From: Kelly online Date: Sat, 19 Jun 2021 23:28:58 +0100 Subject: [PATCH 09/25] refactored according to suggested changes in comment --- .github/workflows/backend.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index 7afaa02e..15f5aed2 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -3,7 +3,7 @@ # it runs the jobs on the API/ directory and deploys using secret credentials # Update the secret credentials with details from the Azure web server. -name: "CI/CD Pipeline for Azure webapp deployment" +name: "Pipeline for Azure webapp deployment" on: push: @@ -17,10 +17,7 @@ jobs: build_and_deploy: name: Build test and Deploy Node App to Azure runs-on: ubuntu-latest - if: >- - github.event_name == 'push' || (github.event_name == 'pull_request' && - github.event.action != 'closed') - environment: production + steps: - uses: actions/checkout@v2 - name: Use Node.js @@ -29,19 +26,18 @@ jobs: node-version: "14.x" - name: npm install, build, and test run: | - pwd - ls cd API/ npm install npm run build --if-present npm run test --if-present echo Successful + - if: github.ref == 'refs/heads/master' && job.status == 'success' + run: | + git push -u origin HEAD:master + - name: "Deploy to Azure" uses: azure/webapps-deploy@v2 with: app-name: ${{ secrets.AZURE_WEBAPP_NAME }} publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} package: ${{ secrets.AZURE_WEBAPP_PACKAGE_PATH }} - - if: github.ref == 'refs/heads/master' && job.status == 'success' - run: | - git push -u origin HEAD:master -f From d0e35cc45e32807a97110e97cff2bc5ddf237a4b Mon Sep 17 00:00:00 2001 From: Kelly online Date: Sat, 19 Jun 2021 23:34:23 +0100 Subject: [PATCH 10/25] fixed an omission --- .github/workflows/backend.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index 15f5aed2..f41e2a7b 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -33,7 +33,7 @@ jobs: echo Successful - if: github.ref == 'refs/heads/master' && job.status == 'success' run: | - git push -u origin HEAD:master + git push -u origin HEAD:master -f - name: "Deploy to Azure" uses: azure/webapps-deploy@v2 From 24dcca2937f65161660a298d194f58d031e28359 Mon Sep 17 00:00:00 2001 From: Kelly online Date: Mon, 21 Jun 2021 23:21:38 +0100 Subject: [PATCH 11/25] Update backend.yml --- .github/workflows/backend.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index f41e2a7b..04df8125 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -19,18 +19,6 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Use Node.js - uses: actions/setup-node@v1 - with: - node-version: "14.x" - - name: npm install, build, and test - run: | - cd API/ - npm install - npm run build --if-present - npm run test --if-present - echo Successful - if: github.ref == 'refs/heads/master' && job.status == 'success' run: | git push -u origin HEAD:master -f From 6a7e8c72c53574281ccce29dd0791be7d914088f Mon Sep 17 00:00:00 2001 From: Kelly online Date: Mon, 21 Jun 2021 23:29:52 +0100 Subject: [PATCH 12/25] removed secrets --- .github/workflows/backend.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index 04df8125..2abe2b85 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -25,7 +25,3 @@ jobs: - name: "Deploy to Azure" uses: azure/webapps-deploy@v2 - with: - app-name: ${{ secrets.AZURE_WEBAPP_NAME }} - publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} - package: ${{ secrets.AZURE_WEBAPP_PACKAGE_PATH }} From 961765b95ddeaae71b7570421045107397cb42a5 Mon Sep 17 00:00:00 2001 From: Kelly online Date: Mon, 21 Jun 2021 23:32:39 +0100 Subject: [PATCH 13/25] Update backend.yml --- .github/workflows/backend.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index 2abe2b85..9810147b 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -22,6 +22,3 @@ jobs: - if: github.ref == 'refs/heads/master' && job.status == 'success' run: | git push -u origin HEAD:master -f - - - name: "Deploy to Azure" - uses: azure/webapps-deploy@v2 From 40b043699bd0e54bd5aaa68800451ed409d03a98 Mon Sep 17 00:00:00 2001 From: Kelly online Date: Tue, 22 Jun 2021 10:08:39 +0100 Subject: [PATCH 14/25] added npm build and test setup --- .github/workflows/backend.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index 9810147b..1303d473 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -19,6 +19,18 @@ jobs: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v2 + - name: Use Node.js + uses: actions/setup-node@v1 + with: + node-version: "14.x" + - name: npm install, build, and test + run: | + cd API/ + npm install + npm run build --if-present + npm run test --if-present + echo Successful - if: github.ref == 'refs/heads/master' && job.status == 'success' run: | git push -u origin HEAD:master -f From 6a22b8c7a473599dc7567e883f40f7abcdc49920 Mon Sep 17 00:00:00 2001 From: Kelly online Date: Wed, 23 Jun 2021 12:03:14 +0100 Subject: [PATCH 15/25] added and updated package.json file --- package-lock.json | 63 +++-------------------------------------------- package.json | 23 +++++++++++++++++ 2 files changed, 26 insertions(+), 60 deletions(-) create mode 100644 package.json diff --git a/package-lock.json b/package-lock.json index b95aa1c8..c35bd00a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,62 +1,5 @@ { - "requires": true, - "lockfileVersion": 1, - "dependencies": { - "@babel/runtime": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.13.tgz", - "integrity": "sha512-8+3UMPBrjFa/6TtKi/7sehPKqfAm4g6K+YQjyyFOLUTxzOngcRZTlAVY8sc2CORJYqdHQY8gRPHmn+qo15rCBw==", - "requires": { - "regenerator-runtime": "^0.13.4" - } - }, - "html-parse-stringify2": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/html-parse-stringify2/-/html-parse-stringify2-2.0.1.tgz", - "integrity": "sha1-3FZwtyksoVi3vJFsmmc1rIhyg0o=", - "requires": { - "void-elements": "^2.0.1" - } - }, - "i18next-browser-languagedetector": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/i18next-browser-languagedetector/-/i18next-browser-languagedetector-6.0.1.tgz", - "integrity": "sha512-3H+OsNQn3FciomUU0d4zPFHsvJv4X66lBelXk9hnIDYDsveIgT7dWZ3/VvcSlpKk9lvCK770blRZ/CwHMXZqWw==", - "requires": { - "@babel/runtime": "^7.5.5" - } - }, - "i18next-http-backend": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/i18next-http-backend/-/i18next-http-backend-1.1.0.tgz", - "integrity": "sha512-utp3MyUQpIUD5Jxkf5xz0GWYWDSte7uuf1F4qaLtVtIqlcFcyYQ2l22el1JPK3rAL44+sjhB7+ct0Qr2WpbxNA==", - "requires": { - "node-fetch": "2.6.1" - } - }, - "node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" - }, - "react-i18next": { - "version": "11.8.6", - "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-11.8.6.tgz", - "integrity": "sha512-Nr4Fq7BvzDLJQmaDyJRkPPINgMW1Y1qeT4STBoY/ePGmYlCZGShTYqqyBm0ly6M8dV1X0twt7M5dfmDzfi9yGQ==", - "requires": { - "@babel/runtime": "^7.3.1", - "html-parse-stringify2": "2.0.1" - } - }, - "regenerator-runtime": { - "version": "0.13.7", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz", - "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==" - }, - "void-elements": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz", - "integrity": "sha1-wGavtYK7HLQSjWDqkjkulNXp2+w=" - } - } + "name": "ProjectLockdown", + "version": "1.0.0", + "lockfileVersion": 1 } diff --git a/package.json b/package.json new file mode 100644 index 00000000..ad5dc1ea --- /dev/null +++ b/package.json @@ -0,0 +1,23 @@ +{ + "name": "ProjectLockdown", + "version": "2.0.0", + "description": "\r ![logo](http://TIOF.Click/PLDRepoHeader)", + "main": "index.js", + "directories": { + "doc": "docs" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/iamfredrickokereke/ProjectLockdown.git" + }, + "keywords": [], + "author": "", + "license": "ISC", + "bugs": { + "url": "https://github.com/iamfredrickokereke/ProjectLockdown/issues" + }, + "homepage": "https://github.com/iamfredrickokereke/ProjectLockdown#readme" +} From 3daccc681cca19c488c9fc094e5cd990b5729eeb Mon Sep 17 00:00:00 2001 From: Kelly online Date: Wed, 23 Jun 2021 13:11:48 +0100 Subject: [PATCH 16/25] updated node version --- .github/workflows/backend.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index 1303d473..4d4b0945 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -21,9 +21,9 @@ jobs: steps: - uses: actions/checkout@v2 - name: Use Node.js - uses: actions/setup-node@v1 + uses: actions/setup-node@v2 with: - node-version: "14.x" + node-version: "14" - name: npm install, build, and test run: | cd API/ From a54535781e6ea657c4b2d5de284eb08d4639ab11 Mon Sep 17 00:00:00 2001 From: Kelly online Date: Wed, 23 Jun 2021 14:01:57 +0100 Subject: [PATCH 17/25] Update package.json --- package.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package.json b/package.json index ad5dc1ea..863b56d2 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,10 @@ "version": "2.0.0", "description": "\r ![logo](http://TIOF.Click/PLDRepoHeader)", "main": "index.js", + "engines": { + "node": ">10.0.0", + "npm": ">4.2.0" + }, "directories": { "doc": "docs" }, From da401ff7d415572a40f4a0f09fcae73e0dea5bb2 Mon Sep 17 00:00:00 2001 From: Kelly online Date: Wed, 23 Jun 2021 14:23:32 +0100 Subject: [PATCH 18/25] cleared npm cache --- .github/workflows/backend.yml | 1 + package-lock.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index 4d4b0945..33f31f5c 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -27,6 +27,7 @@ jobs: - name: npm install, build, and test run: | cd API/ + npm cache clear --force npm install npm run build --if-present npm run test --if-present diff --git a/package-lock.json b/package-lock.json index c35bd00a..12fb368d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { "name": "ProjectLockdown", - "version": "1.0.0", + "version": "2.0.0", "lockfileVersion": 1 } From 0810ad26be99bacda52622566c2bb488bff46f5d Mon Sep 17 00:00:00 2001 From: Kelly online Date: Wed, 23 Jun 2021 15:38:02 +0100 Subject: [PATCH 19/25] old entry removed and package.json file updated to version 2.0.0 from API directory --- .github/workflows/backend.yml | 1 - API/package.json | 132 +++++++++++++++++----------------- package.json | 4 -- 3 files changed, 66 insertions(+), 71 deletions(-) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index 33f31f5c..4d4b0945 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -27,7 +27,6 @@ jobs: - name: npm install, build, and test run: | cd API/ - npm cache clear --force npm install npm run build --if-present npm run test --if-present diff --git a/API/package.json b/API/package.json index 68a30674..00254671 100644 --- a/API/package.json +++ b/API/package.json @@ -1,69 +1,69 @@ { - "name": "lockdown-api", - "version": "2.0", - "description": "", - "author": "Project Lockdown", - "private": true, - "scripts": { - "prebuild": "rimraf dist", - "build": "nest build", - "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", - "start": "nest start", - "start:dev": "nest start --watch", - "start:debug": "nest start --debug --watch", - "start:prod": "node dist/main", - "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", - "test": "jest", - "test:watch": "jest --watch", - "test:cov": "jest --coverage", - "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand", - "test:e2e": "jest --config ./test/jest-e2e.json" - }, - "dependencies": { - "@nestjs/common": "^7.6.15", - "@nestjs/core": "^7.6.15", - "@nestjs/platform-express": "^7.6.15", - "reflect-metadata": "^0.1.13", - "rimraf": "^3.0.2", - "rxjs": "^6.6.6" - }, - "devDependencies": { - "@nestjs/cli": "^7.6.0", - "@nestjs/schematics": "^7.3.0", - "@nestjs/testing": "^7.6.15", - "@types/express": "^4.17.11", - "@types/jest": "^26.0.22", - "@types/node": "^14.14.36", - "@types/supertest": "^2.0.10", - "@typescript-eslint/eslint-plugin": "^4.19.0", - "@typescript-eslint/parser": "^4.19.0", - "eslint": "^7.22.0", - "eslint-config-prettier": "^8.1.0", - "eslint-plugin-prettier": "^3.3.1", - "jest": "^26.6.3", - "prettier": "^2.2.1", - "supertest": "^6.1.3", - "ts-jest": "^26.5.4", - "ts-loader": "^8.0.18", - "ts-node": "^9.1.1", - "tsconfig-paths": "^3.9.0", - "typescript": "^4.2.3" - }, - "jest": { - "moduleFileExtensions": [ - "js", - "json", - "ts" - ], - "rootDir": "src/", - "testRegex": ".*\\.test\\.ts$", - "transform": { - "^.+\\.(t|j)s$": "ts-jest" + "name": "lockdown-api", + "version": "2.0.0", + "description": "", + "author": "Project Lockdown", + "private": true, + "scripts": { + "prebuild": "rimraf dist", + "build": "nest build", + "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", + "start": "nest start", + "start:dev": "nest start --watch", + "start:debug": "nest start --debug --watch", + "start:prod": "node dist/main", + "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", + "test": "jest", + "test:watch": "jest --watch", + "test:cov": "jest --coverage", + "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand", + "test:e2e": "jest --config ./test/jest-e2e.json" }, - "collectCoverageFrom": [ - "**/*.(t|j)s" - ], - "coverageDirectory": "../coverage", - "testEnvironment": "node" - } + "dependencies": { + "@nestjs/common": "^7.6.15", + "@nestjs/core": "^7.6.15", + "@nestjs/platform-express": "^7.6.15", + "reflect-metadata": "^0.1.13", + "rimraf": "^3.0.2", + "rxjs": "^6.6.6" + }, + "devDependencies": { + "@nestjs/cli": "^7.6.0", + "@nestjs/schematics": "^7.3.0", + "@nestjs/testing": "^7.6.15", + "@types/express": "^4.17.11", + "@types/jest": "^26.0.22", + "@types/node": "^14.14.36", + "@types/supertest": "^2.0.10", + "@typescript-eslint/eslint-plugin": "^4.19.0", + "@typescript-eslint/parser": "^4.19.0", + "eslint": "^7.22.0", + "eslint-config-prettier": "^8.1.0", + "eslint-plugin-prettier": "^3.3.1", + "jest": "^26.6.3", + "prettier": "^2.2.1", + "supertest": "^6.1.3", + "ts-jest": "^26.5.4", + "ts-loader": "^8.0.18", + "ts-node": "^9.1.1", + "tsconfig-paths": "^3.9.0", + "typescript": "^4.2.3" + }, + "jest": { + "moduleFileExtensions": [ + "js", + "json", + "ts" + ], + "rootDir": "src/", + "testRegex": ".*\\.test\\.ts$", + "transform": { + "^.+\\.(t|j)s$": "ts-jest" + }, + "collectCoverageFrom": [ + "**/*.(t|j)s" + ], + "coverageDirectory": "../coverage", + "testEnvironment": "node" + } } diff --git a/package.json b/package.json index 863b56d2..ad5dc1ea 100644 --- a/package.json +++ b/package.json @@ -3,10 +3,6 @@ "version": "2.0.0", "description": "\r ![logo](http://TIOF.Click/PLDRepoHeader)", "main": "index.js", - "engines": { - "node": ">10.0.0", - "npm": ">4.2.0" - }, "directories": { "doc": "docs" }, From ce0ab0f43bf8c2c331a5ac833c34c34109a15072 Mon Sep 17 00:00:00 2001 From: Kelly online Date: Mon, 28 Jun 2021 22:28:18 +0100 Subject: [PATCH 20/25] removed the package.json files outside API directory --- package-lock.json | 5 ----- package.json | 23 ----------------------- 2 files changed, 28 deletions(-) delete mode 100644 package-lock.json delete mode 100644 package.json diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 12fb368d..00000000 --- a/package-lock.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "ProjectLockdown", - "version": "2.0.0", - "lockfileVersion": 1 -} diff --git a/package.json b/package.json deleted file mode 100644 index ad5dc1ea..00000000 --- a/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "ProjectLockdown", - "version": "2.0.0", - "description": "\r ![logo](http://TIOF.Click/PLDRepoHeader)", - "main": "index.js", - "directories": { - "doc": "docs" - }, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/iamfredrickokereke/ProjectLockdown.git" - }, - "keywords": [], - "author": "", - "license": "ISC", - "bugs": { - "url": "https://github.com/iamfredrickokereke/ProjectLockdown/issues" - }, - "homepage": "https://github.com/iamfredrickokereke/ProjectLockdown#readme" -} From 8f1a102efdea4f22be0c78b17a49d47f7b865ba8 Mon Sep 17 00:00:00 2001 From: Kelly online Date: Mon, 28 Jun 2021 22:29:23 +0100 Subject: [PATCH 21/25] added passWithNoTest Flag --- .github/workflows/backend.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index 4d4b0945..0d315f62 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -29,7 +29,7 @@ jobs: cd API/ npm install npm run build --if-present - npm run test --if-present + npm run test --passWithNoTests echo Successful - if: github.ref == 'refs/heads/master' && job.status == 'success' run: | From 65c3effca7c154b8ed393ba4a95818b62489c427 Mon Sep 17 00:00:00 2001 From: Kelly online Date: Mon, 28 Jun 2021 22:32:50 +0100 Subject: [PATCH 22/25] removed the push to master if check --- .github/workflows/backend.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index 0d315f62..17b0d810 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -31,6 +31,3 @@ jobs: npm run build --if-present npm run test --passWithNoTests echo Successful - - if: github.ref == 'refs/heads/master' && job.status == 'success' - run: | - git push -u origin HEAD:master -f From 674f55d78b6e7a32d16ffe3d20f8b581d9edea8d Mon Sep 17 00:00:00 2001 From: Kelly online Date: Mon, 28 Jun 2021 22:38:45 +0100 Subject: [PATCH 23/25] added deploy to azure actions with secret variable --- .github/workflows/backend.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index 17b0d810..d8306318 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -31,3 +31,10 @@ jobs: npm run build --if-present npm run test --passWithNoTests echo Successful + + - name: "Deploy to Azure" + uses: azure/webapps-deploy@v2 + with: + app-name: ${{ secrets.AZURE_WEBAPP_NAME }} + publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} + package: ${{ secrets.AZURE_WEBAPP_PACKAGE_PATH }} From 976b18c596aa154886f738fbad0060c4d5520857 Mon Sep 17 00:00:00 2001 From: Kelly online Date: Wed, 30 Jun 2021 11:22:32 +0100 Subject: [PATCH 24/25] added the if clause to push to master --- .github/workflows/backend.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index d8306318..1241d8fa 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -38,3 +38,4 @@ jobs: app-name: ${{ secrets.AZURE_WEBAPP_NAME }} publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} package: ${{ secrets.AZURE_WEBAPP_PACKAGE_PATH }} + - if: github.ref == 'refs/heads/master' && job.status == 'success' From bf2b1c0a3c0e3d2d0c5d97d37337a8cb868bd2b9 Mon Sep 17 00:00:00 2001 From: Kelly online Date: Wed, 30 Jun 2021 12:53:42 +0100 Subject: [PATCH 25/25] Update backend.yml --- .github/workflows/backend.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index 1241d8fa..e1e42c07 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -38,4 +38,4 @@ jobs: app-name: ${{ secrets.AZURE_WEBAPP_NAME }} publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} package: ${{ secrets.AZURE_WEBAPP_PACKAGE_PATH }} - - if: github.ref == 'refs/heads/master' && job.status == 'success' + if: github.ref == 'refs/heads/master' && job.status == 'success'