From 816a12080d04be8e509dc19966a3564fb1dc4ead Mon Sep 17 00:00:00 2001 From: "DESKTOP-Q2JDODV\\Admin" Date: Wed, 23 Jun 2021 13:47:38 +0300 Subject: [PATCH 01/13] chore: add azure-cli deploy action workflow --- .github/workflows/azureCliDeploy.yml | 41 ++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/azureCliDeploy.yml diff --git a/.github/workflows/azureCliDeploy.yml b/.github/workflows/azureCliDeploy.yml new file mode 100644 index 00000000..4985ca59 --- /dev/null +++ b/.github/workflows/azureCliDeploy.yml @@ -0,0 +1,41 @@ +name: Ngx-Admin Blob storage CI + +on: + push: + branches: + - demo + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2l + - name: Use Node.js 10.x + uses: actions/setup-node@v1 + with: + node-version: '10.x' + - uses: actions/checkout@v2ll + with: + ref: demo + - name: npm install, build + run: | + npm install + npm run build:demo:prod + + # Azure CLI Upload to storage + - uses: actions/checkout@v2 + - uses: azure/login@v1 + with: + creds: ${{ secrets.AZURE_RBAC_CREDENTIALS }} + - name: Upload to blob storage + uses: azure/CLI@v1 + with: + azcliversion: 2.0.72 + inlineScript: | + az storage blob upload-batch --account-name ngxadmin -s dist/ -d '$web'. + + # Azure logout + - name: logout + run: | + az logout + if: always() From 114050f8511811ffa77bb8f7313d95611984c8bb Mon Sep 17 00:00:00 2001 From: "DESKTOP-Q2JDODV\\Admin" Date: Wed, 23 Jun 2021 14:47:12 +0300 Subject: [PATCH 02/13] chore: chenge the name branch --- .github/workflows/azureCliDeploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/azureCliDeploy.yml b/.github/workflows/azureCliDeploy.yml index 4985ca59..21e0891c 100644 --- a/.github/workflows/azureCliDeploy.yml +++ b/.github/workflows/azureCliDeploy.yml @@ -3,7 +3,7 @@ name: Ngx-Admin Blob storage CI on: push: branches: - - demo + - azureCliDeploy-demo jobs: build: @@ -16,7 +16,7 @@ jobs: node-version: '10.x' - uses: actions/checkout@v2ll with: - ref: demo + ref: azureCliDeploy-demo - name: npm install, build run: | npm install From 5f40fd4c3799f026d879a56a616e3d1603521b50 Mon Sep 17 00:00:00 2001 From: "DESKTOP-Q2JDODV\\Admin" Date: Wed, 23 Jun 2021 14:57:41 +0300 Subject: [PATCH 03/13] chore: change the checkout version --- .github/workflows/azureCliDeploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/azureCliDeploy.yml b/.github/workflows/azureCliDeploy.yml index 21e0891c..6ef963b3 100644 --- a/.github/workflows/azureCliDeploy.yml +++ b/.github/workflows/azureCliDeploy.yml @@ -9,12 +9,12 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2l + - uses: actions/checkout@v2 - name: Use Node.js 10.x uses: actions/setup-node@v1 with: node-version: '10.x' - - uses: actions/checkout@v2ll + - uses: actions/checkout@v2 with: ref: azureCliDeploy-demo - name: npm install, build From caecd792c280900558b9b3ec9033edea8982f765 Mon Sep 17 00:00:00 2001 From: "DESKTOP-Q2JDODV\\Admin" Date: Wed, 23 Jun 2021 15:41:54 +0300 Subject: [PATCH 04/13] chore: add debug and change the source --- .github/workflows/azureCliDeploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azureCliDeploy.yml b/.github/workflows/azureCliDeploy.yml index 6ef963b3..7965026a 100644 --- a/.github/workflows/azureCliDeploy.yml +++ b/.github/workflows/azureCliDeploy.yml @@ -32,7 +32,7 @@ jobs: with: azcliversion: 2.0.72 inlineScript: | - az storage blob upload-batch --account-name ngxadmin -s dist/ -d '$web'. + az storage blob upload-batch --account-name ngxadmin -s .dist -d '$web' --debug # Azure logout - name: logout From cfcdf741b127b410b555d8dc5291e1873019e6f2 Mon Sep 17 00:00:00 2001 From: "DESKTOP-Q2JDODV\\Admin" Date: Wed, 23 Jun 2021 15:50:47 +0300 Subject: [PATCH 05/13] chore: fix issue with source dist --- .github/workflows/azureCliDeploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azureCliDeploy.yml b/.github/workflows/azureCliDeploy.yml index 7965026a..2e1f6f61 100644 --- a/.github/workflows/azureCliDeploy.yml +++ b/.github/workflows/azureCliDeploy.yml @@ -32,7 +32,7 @@ jobs: with: azcliversion: 2.0.72 inlineScript: | - az storage blob upload-batch --account-name ngxadmin -s .dist -d '$web' --debug + az storage blob upload-batch -d '$web' -s dist --account-name ngxadmin --debug # Azure logout - name: logout From 64972f88c51a37816309cc69dc6264539982ca23 Mon Sep 17 00:00:00 2001 From: "DESKTOP-Q2JDODV\\Admin" Date: Wed, 23 Jun 2021 16:03:18 +0300 Subject: [PATCH 06/13] chore: remove the 3d checkout --- .github/workflows/azureCliDeploy.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/azureCliDeploy.yml b/.github/workflows/azureCliDeploy.yml index 2e1f6f61..9960d091 100644 --- a/.github/workflows/azureCliDeploy.yml +++ b/.github/workflows/azureCliDeploy.yml @@ -23,7 +23,6 @@ jobs: npm run build:demo:prod # Azure CLI Upload to storage - - uses: actions/checkout@v2 - uses: azure/login@v1 with: creds: ${{ secrets.AZURE_RBAC_CREDENTIALS }} From 03ef3613c9f96012c6a01269a7f318a5eeaa25c4 Mon Sep 17 00:00:00 2001 From: "DESKTOP-Q2JDODV\\Admin" Date: Wed, 23 Jun 2021 19:18:25 +0300 Subject: [PATCH 07/13] chore: change the base href --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 79624de0..72eae28d 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "start": "ng serve", "build": "ng build", "build:prod": "npm run build -- --prod --aot", - "build:demo:prod": "npm run build -- --prod --aot --base-href /ngx-admin/", + "build:demo:prod": "npm run build -- --prod --aot --base-href /demo-azure/", "test": "ng test", "test:coverage": "rimraf coverage && npm run test -- --code-coverage", "lint": "ng lint", From af892e8da4c37a30392d11172af73d0a4670666e Mon Sep 17 00:00:00 2001 From: "DESKTOP-Q2JDODV\\Admin" Date: Thu, 24 Jun 2021 10:30:01 +0300 Subject: [PATCH 08/13] refactor: rename the action to deploy to azure storage --- .github/workflows/azureCliDeploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azureCliDeploy.yml b/.github/workflows/azureCliDeploy.yml index 9960d091..ef53a7f0 100644 --- a/.github/workflows/azureCliDeploy.yml +++ b/.github/workflows/azureCliDeploy.yml @@ -1,4 +1,4 @@ -name: Ngx-Admin Blob storage CI +name: Deploy to demo blob (azure storage) on: push: From 6b07e042e8936948df793ad11726cefd82bfe6f1 Mon Sep 17 00:00:00 2001 From: "DESKTOP-Q2JDODV\\Admin" Date: Thu, 24 Jun 2021 14:28:56 +0300 Subject: [PATCH 09/13] refactor: rollback the base href --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 72eae28d..79624de0 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "start": "ng serve", "build": "ng build", "build:prod": "npm run build -- --prod --aot", - "build:demo:prod": "npm run build -- --prod --aot --base-href /demo-azure/", + "build:demo:prod": "npm run build -- --prod --aot --base-href /ngx-admin/", "test": "ng test", "test:coverage": "rimraf coverage && npm run test -- --code-coverage", "lint": "ng lint", From 9548eff5fad5a4a11a90503d7d3f054ac749b5f6 Mon Sep 17 00:00:00 2001 From: "DESKTOP-Q2JDODV\\Admin" Date: Thu, 24 Jun 2021 14:29:24 +0300 Subject: [PATCH 10/13] refactor: change the branch name for deploy --- .github/workflows/azureCliDeploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/azureCliDeploy.yml b/.github/workflows/azureCliDeploy.yml index ef53a7f0..153f6cc0 100644 --- a/.github/workflows/azureCliDeploy.yml +++ b/.github/workflows/azureCliDeploy.yml @@ -3,7 +3,7 @@ name: Deploy to demo blob (azure storage) on: push: branches: - - azureCliDeploy-demo + - demo jobs: build: @@ -16,7 +16,7 @@ jobs: node-version: '10.x' - uses: actions/checkout@v2 with: - ref: azureCliDeploy-demo + ref: demo - name: npm install, build run: | npm install From 11e49c489bfe8ab4d71f0bf6a303145ba16f56e7 Mon Sep 17 00:00:00 2001 From: "DESKTOP-Q2JDODV\\Admin" Date: Thu, 24 Jun 2021 14:31:38 +0300 Subject: [PATCH 11/13] refactor: rename the action workflow for azure storage --- .github/workflows/azureCliDeploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azureCliDeploy.yml b/.github/workflows/azureCliDeploy.yml index 153f6cc0..5a9f98a8 100644 --- a/.github/workflows/azureCliDeploy.yml +++ b/.github/workflows/azureCliDeploy.yml @@ -1,4 +1,4 @@ -name: Deploy to demo blob (azure storage) +name: Deploy to demo (azure storage) on: push: From d60906976cc18f7039afc149adfb9d21180c7e60 Mon Sep 17 00:00:00 2001 From: "DESKTOP-Q2JDODV\\Admin" Date: Thu, 24 Jun 2021 14:33:36 +0300 Subject: [PATCH 12/13] chore: comment the old version of the github action-workflow for deploy to VM --- .github/workflows/demoDeploy.yml | 58 ++++++++++++++++---------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/.github/workflows/demoDeploy.yml b/.github/workflows/demoDeploy.yml index 140f62bb..6e18608e 100644 --- a/.github/workflows/demoDeploy.yml +++ b/.github/workflows/demoDeploy.yml @@ -1,29 +1,29 @@ - -name: Deploy to demo - -on: - push: - branches: - - 'demo' - paths: - - 'src/**' - repository_dispatch: - types: deploy-to-demo - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Install SSH key - uses: shimataro/ssh-key-action@v2 - with: - key: ${{ secrets.SSH_KEY }} - known_hosts: ${{ secrets.KNOWN_HOSTS }} - - name: Use Node.js 12.x - uses: actions/setup-node@v1 - - uses: actions/checkout@v2 - with: - ref: demo - - run: npm install - - run: npm run build:demo:prod - - run: rsync -r --delete-after dist/. "${{ secrets.REMOTE_URL }}":"${{ secrets.ADDRESS }}" +# +#name: (Obsolete) Deploy to demo (VM) +# +#on: +# push: +# branches: +# - 'demo' +# paths: +# - 'src/**' +# repository_dispatch: +# types: deploy-to-demo +# +#jobs: +# build: +# runs-on: ubuntu-latest +# steps: +# - name: Install SSH key +# uses: shimataro/ssh-key-action@v2 +# with: +# key: ${{ secrets.SSH_KEY }} +# known_hosts: ${{ secrets.KNOWN_HOSTS }} +# - name: Use Node.js 12.x +# uses: actions/setup-node@v1 +# - uses: actions/checkout@v2 +# with: +# ref: demo +# - run: npm install +# - run: npm run build:demo:prod +# - run: rsync -r --delete-after dist/. "${{ secrets.REMOTE_URL }}":"${{ secrets.ADDRESS }}" From e652239c47881713777f8aba9be421d866896749 Mon Sep 17 00:00:00 2001 From: "DESKTOP-Q2JDODV\\Admin" Date: Thu, 24 Jun 2021 14:38:14 +0300 Subject: [PATCH 13/13] chore: dele the obsolete deploy to demo --- .github/workflows/demoDeploy.yml | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 .github/workflows/demoDeploy.yml diff --git a/.github/workflows/demoDeploy.yml b/.github/workflows/demoDeploy.yml deleted file mode 100644 index 6e18608e..00000000 --- a/.github/workflows/demoDeploy.yml +++ /dev/null @@ -1,29 +0,0 @@ -# -#name: (Obsolete) Deploy to demo (VM) -# -#on: -# push: -# branches: -# - 'demo' -# paths: -# - 'src/**' -# repository_dispatch: -# types: deploy-to-demo -# -#jobs: -# build: -# runs-on: ubuntu-latest -# steps: -# - name: Install SSH key -# uses: shimataro/ssh-key-action@v2 -# with: -# key: ${{ secrets.SSH_KEY }} -# known_hosts: ${{ secrets.KNOWN_HOSTS }} -# - name: Use Node.js 12.x -# uses: actions/setup-node@v1 -# - uses: actions/checkout@v2 -# with: -# ref: demo -# - run: npm install -# - run: npm run build:demo:prod -# - run: rsync -r --delete-after dist/. "${{ secrets.REMOTE_URL }}":"${{ secrets.ADDRESS }}"