From 18468f419153485f4ab098f909767f5b8829233d Mon Sep 17 00:00:00 2001 From: Colin Beeby Date: Tue, 4 Feb 2025 15:56:40 +0000 Subject: [PATCH 01/18] Added deployment-dev workflow --- .github/workflows/deployment-dev.yml | 29 ++++++++++++++++++++++++++++ .gitignore | 1 + 2 files changed, 30 insertions(+) create mode 100644 .github/workflows/deployment-dev.yml diff --git a/.github/workflows/deployment-dev.yml b/.github/workflows/deployment-dev.yml new file mode 100644 index 0000000..e0927b3 --- /dev/null +++ b/.github/workflows/deployment-dev.yml @@ -0,0 +1,29 @@ +name: Deploy theme to moodle dev + +on: + workflow_dispatch + +jobs: + copy_files: + name: Copy files from github to Azure storage + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: 'Az CLI login' + uses: azure/login@v1 + with: + client-id: ${{ vars.AZURE_CLIENT_ID }} + tenant-id: ${{ vars.AZURE_TENANT_ID }} + subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }} + + - name: Copy files + run: | + find . -type f \ + -not -path "./.git/*" \ + -not -path "./.github/*" \ + -not -path "./.vs/*" \ + -not -name ".gitattributes" \ + -not -name ".gitignore" \ + -exec az storage file upload --account-name ${{ vars.AZURE_STORAGE_ACCOUNT }} --share-name ${{ vars.AZURE_FILE_SHARE }} --source '{}' --path 'nhse/{}' \; diff --git a/.gitignore b/.gitignore index 7e5da87..0b42136 100755 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules/ vendor/ +/.vs \ No newline at end of file From b028fe2d07f30a15e272e04982be66e9eb4ae02c Mon Sep 17 00:00:00 2001 From: Colin Beeby Date: Tue, 4 Feb 2025 15:59:33 +0000 Subject: [PATCH 02/18] Added deployment-dev workflow --- .github/workflows/deployment-dev.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deployment-dev.yml b/.github/workflows/deployment-dev.yml index e0927b3..5c3fe5d 100644 --- a/.github/workflows/deployment-dev.yml +++ b/.github/workflows/deployment-dev.yml @@ -1,7 +1,9 @@ name: Deploy theme to moodle dev on: - workflow_dispatch + push: + branches: + - addDeploymentWorkflow jobs: copy_files: From cf6b59c80dec2740c908e00d7371f30e243b2264 Mon Sep 17 00:00:00 2001 From: Colin Beeby Date: Tue, 4 Feb 2025 16:01:26 +0000 Subject: [PATCH 03/18] Added deployment-dev workflow --- .github/workflows/deployment-dev.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deployment-dev.yml b/.github/workflows/deployment-dev.yml index 5c3fe5d..db88c5e 100644 --- a/.github/workflows/deployment-dev.yml +++ b/.github/workflows/deployment-dev.yml @@ -9,6 +9,7 @@ jobs: copy_files: name: Copy files from github to Azure storage runs-on: ubuntu-latest + environment: dev steps: - uses: actions/checkout@v3 From 006fcff755278ff2c8a8eefc143e440e973eaeb8 Mon Sep 17 00:00:00 2001 From: Colin Beeby Date: Tue, 4 Feb 2025 16:08:44 +0000 Subject: [PATCH 04/18] Added deployment-dev workflow --- .github/workflows/deployment-dev.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/deployment-dev.yml b/.github/workflows/deployment-dev.yml index db88c5e..b85d139 100644 --- a/.github/workflows/deployment-dev.yml +++ b/.github/workflows/deployment-dev.yml @@ -5,6 +5,10 @@ on: branches: - addDeploymentWorkflow +permissions: + id-token: write + contents: read + jobs: copy_files: name: Copy files from github to Azure storage From b3134bc7c05eaee9f85fbfa6208a3e7e91282bfc Mon Sep 17 00:00:00 2001 From: Colin Beeby Date: Tue, 4 Feb 2025 16:28:44 +0000 Subject: [PATCH 05/18] Added deployment-dev workflow --- .github/workflows/deployment-dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment-dev.yml b/.github/workflows/deployment-dev.yml index b85d139..a18aba0 100644 --- a/.github/workflows/deployment-dev.yml +++ b/.github/workflows/deployment-dev.yml @@ -33,4 +33,4 @@ jobs: -not -path "./.vs/*" \ -not -name ".gitattributes" \ -not -name ".gitignore" \ - -exec az storage file upload --account-name ${{ vars.AZURE_STORAGE_ACCOUNT }} --share-name ${{ vars.AZURE_FILE_SHARE }} --source '{}' --path 'nhse/{}' \; + -exec az storage file upload --account-name ${{ vars.AZURE_STORAGE_ACCOUNT }} --share-name ${{ vars.AZURE_FILE_SHARE }} --source '{}' --path 'nhse/{}' --account-key ${{ secrets.AZURE_STORAGE_ACCOUNT_KEY }} \; From c48fc34c96f2f90a169e362f10596b5be7a5a1ab Mon Sep 17 00:00:00 2001 From: Colin Beeby Date: Tue, 4 Feb 2025 16:53:08 +0000 Subject: [PATCH 06/18] Added deployment-dev workflow --- .github/workflows/deployment-dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment-dev.yml b/.github/workflows/deployment-dev.yml index a18aba0..4808a81 100644 --- a/.github/workflows/deployment-dev.yml +++ b/.github/workflows/deployment-dev.yml @@ -33,4 +33,4 @@ jobs: -not -path "./.vs/*" \ -not -name ".gitattributes" \ -not -name ".gitignore" \ - -exec az storage file upload --account-name ${{ vars.AZURE_STORAGE_ACCOUNT }} --share-name ${{ vars.AZURE_FILE_SHARE }} --source '{}' --path 'nhse/{}' --account-key ${{ secrets.AZURE_STORAGE_ACCOUNT_KEY }} \; + -exec az storage file upload --account-name ${{ vars.AZURE_STORAGE_ACCOUNT }} --share-name ${{ vars.AZURE_FILE_SHARE }} --source '{}' --path 'nhse/{}' --account-key '${{ secrets.AZURE_STORAGE_ACCOUNT_KEY }}' \; From c1b0379f718aeff3e5fc117ec424c8d9a13de602 Mon Sep 17 00:00:00 2001 From: Colin Beeby Date: Tue, 4 Feb 2025 16:54:57 +0000 Subject: [PATCH 07/18] Added deployment-dev workflow --- .github/workflows/deployment-dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment-dev.yml b/.github/workflows/deployment-dev.yml index 4808a81..3edab18 100644 --- a/.github/workflows/deployment-dev.yml +++ b/.github/workflows/deployment-dev.yml @@ -33,4 +33,4 @@ jobs: -not -path "./.vs/*" \ -not -name ".gitattributes" \ -not -name ".gitignore" \ - -exec az storage file upload --account-name ${{ vars.AZURE_STORAGE_ACCOUNT }} --share-name ${{ vars.AZURE_FILE_SHARE }} --source '{}' --path 'nhse/{}' --account-key '${{ secrets.AZURE_STORAGE_ACCOUNT_KEY }}' \; + -exec az storage file upload --account-name ${{ vars.AZURE_STORAGE_ACCOUNT }} --share-name ${{ vars.AZURE_FILE_SHARE }} --source '{}' --path 'nhse/{}' --connection-string '${{ secrets.AZURE_STORAGE_ACCOUNT_CONNECTION_STRING }}' \; From f37a915968fa48babaf10f20ff52b6afd30419ef Mon Sep 17 00:00:00 2001 From: Colin Beeby Date: Tue, 4 Feb 2025 16:57:40 +0000 Subject: [PATCH 08/18] Added deployment-dev workflow --- .github/workflows/deployment-dev.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deployment-dev.yml b/.github/workflows/deployment-dev.yml index 3edab18..862f10d 100644 --- a/.github/workflows/deployment-dev.yml +++ b/.github/workflows/deployment-dev.yml @@ -27,10 +27,11 @@ jobs: - name: Copy files run: | - find . -type f \ - -not -path "./.git/*" \ - -not -path "./.github/*" \ - -not -path "./.vs/*" \ - -not -name ".gitattributes" \ - -not -name ".gitignore" \ - -exec az storage file upload --account-name ${{ vars.AZURE_STORAGE_ACCOUNT }} --share-name ${{ vars.AZURE_FILE_SHARE }} --source '{}' --path 'nhse/{}' --connection-string '${{ secrets.AZURE_STORAGE_ACCOUNT_CONNECTION_STRING }}' \; + az storage file upload --account-name ${{ vars.AZURE_STORAGE_ACCOUNT }} --share-name ${{ vars.AZURE_FILE_SHARE }} --source 'lib.php' --path 'nhse/lib.php' --connection-string '${{ secrets.AZURE_STORAGE_ACCOUNT_CONNECTION_STRING }}' + # find . -type f \ + # -not -path "./.git/*" \ + # -not -path "./.github/*" \ + # -not -path "./.vs/*" \ + # -not -name ".gitattributes" \ + # -not -name ".gitignore" \ + # -exec az storage file upload --account-name ${{ vars.AZURE_STORAGE_ACCOUNT }} --share-name ${{ vars.AZURE_FILE_SHARE }} --source '{}' --path 'nhse/{}' --connection-string '${{ secrets.AZURE_STORAGE_ACCOUNT_CONNECTION_STRING }}' \; From 60e21cf94ccaa20a32ab937acb3a7f119190c63f Mon Sep 17 00:00:00 2001 From: Colin Beeby Date: Tue, 4 Feb 2025 17:03:35 +0000 Subject: [PATCH 09/18] Added deployment-dev workflow --- .github/workflows/deployment-dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment-dev.yml b/.github/workflows/deployment-dev.yml index 862f10d..02e57ac 100644 --- a/.github/workflows/deployment-dev.yml +++ b/.github/workflows/deployment-dev.yml @@ -27,7 +27,7 @@ jobs: - name: Copy files run: | - az storage file upload --account-name ${{ vars.AZURE_STORAGE_ACCOUNT }} --share-name ${{ vars.AZURE_FILE_SHARE }} --source 'lib.php' --path 'nhse/lib.php' --connection-string '${{ secrets.AZURE_STORAGE_ACCOUNT_CONNECTION_STRING }}' + az storage file upload-batch --account-name ${{ vars.AZURE_STORAGE_ACCOUNT }} --destination ${{ vars.AZURE_FILE_SHARE }}/nhse --source . --connection-string '${{ secrets.AZURE_STORAGE_ACCOUNT_CONNECTION_STRING }}' # find . -type f \ # -not -path "./.git/*" \ # -not -path "./.github/*" \ From 9233ed7d08dc6f4097b52e9246ba6c2ada987562 Mon Sep 17 00:00:00 2001 From: Colin Beeby Date: Wed, 5 Feb 2025 13:41:27 +0000 Subject: [PATCH 10/18] Added deployment-dev workflow --- .github/workflows/deployment-dev.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deployment-dev.yml b/.github/workflows/deployment-dev.yml index 02e57ac..95b0b42 100644 --- a/.github/workflows/deployment-dev.yml +++ b/.github/workflows/deployment-dev.yml @@ -27,11 +27,11 @@ jobs: - name: Copy files run: | - az storage file upload-batch --account-name ${{ vars.AZURE_STORAGE_ACCOUNT }} --destination ${{ vars.AZURE_FILE_SHARE }}/nhse --source . --connection-string '${{ secrets.AZURE_STORAGE_ACCOUNT_CONNECTION_STRING }}' - # find . -type f \ - # -not -path "./.git/*" \ - # -not -path "./.github/*" \ - # -not -path "./.vs/*" \ - # -not -name ".gitattributes" \ - # -not -name ".gitignore" \ - # -exec az storage file upload --account-name ${{ vars.AZURE_STORAGE_ACCOUNT }} --share-name ${{ vars.AZURE_FILE_SHARE }} --source '{}' --path 'nhse/{}' --connection-string '${{ secrets.AZURE_STORAGE_ACCOUNT_CONNECTION_STRING }}' \; + # az storage file upload-batch --account-name ${{ vars.AZURE_STORAGE_ACCOUNT }} --destination ${{ vars.AZURE_FILE_SHARE }}/nhse --source . --connection-string '${{ secrets.AZURE_STORAGE_ACCOUNT_CONNECTION_STRING }}' + find . -type f \ + -not -path "./.git/*" \ + -not -path "./.github/*" \ + -not -path "./.vs/*" \ + -not -name ".gitattributes" \ + -not -name ".gitignore" \ + -exec sh -c ''az storage file upload --account-name ${{ vars.AZURE_STORAGE_ACCOUNT }} --share-name ${{ vars.AZURE_FILE_SHARE }} --source {} --path nhse/${1#./}' _ '{}' --account-key ${{ secrets.AZURE_STORAGE_ACCOUNT_KEY }} \; From 59c4fddeff430d2ff71340568708f477a5066371 Mon Sep 17 00:00:00 2001 From: Colin Beeby Date: Wed, 5 Feb 2025 13:43:07 +0000 Subject: [PATCH 11/18] Added deployment-dev workflow --- .github/workflows/deployment-dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment-dev.yml b/.github/workflows/deployment-dev.yml index 95b0b42..4fde31e 100644 --- a/.github/workflows/deployment-dev.yml +++ b/.github/workflows/deployment-dev.yml @@ -34,4 +34,4 @@ jobs: -not -path "./.vs/*" \ -not -name ".gitattributes" \ -not -name ".gitignore" \ - -exec sh -c ''az storage file upload --account-name ${{ vars.AZURE_STORAGE_ACCOUNT }} --share-name ${{ vars.AZURE_FILE_SHARE }} --source {} --path nhse/${1#./}' _ '{}' --account-key ${{ secrets.AZURE_STORAGE_ACCOUNT_KEY }} \; + -exec sh -c 'az storage file upload --account-name ${{ vars.AZURE_STORAGE_ACCOUNT }} --share-name ${{ vars.AZURE_FILE_SHARE }} --source {} --path nhse/${1#./}' _ '{}' --account-key ${{ secrets.AZURE_STORAGE_ACCOUNT_KEY }} \; From a7b112f127851b7f10d977052e020fe5903c37df Mon Sep 17 00:00:00 2001 From: Colin Beeby Date: Wed, 5 Feb 2025 13:49:40 +0000 Subject: [PATCH 12/18] Added deployment-dev workflow --- version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.php b/version.php index 0714e84..14c3743 100755 --- a/version.php +++ b/version.php @@ -26,7 +26,7 @@ defined('MOODLE_INTERNAL') || die(); // This is the version of the plugin. -$plugin->version = 2024120201; +$plugin->version = 2024120202; $plugin->release = '404.4.0'; $plugin->maturity = MATURITY_BETA; From 4b2fe8218ae066f6f22fbaeb427f6a79076c28f1 Mon Sep 17 00:00:00 2001 From: Colin Beeby Date: Wed, 5 Feb 2025 13:55:31 +0000 Subject: [PATCH 13/18] Added deployment-dev workflow --- version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.php b/version.php index 14c3743..0714e84 100755 --- a/version.php +++ b/version.php @@ -26,7 +26,7 @@ defined('MOODLE_INTERNAL') || die(); // This is the version of the plugin. -$plugin->version = 2024120202; +$plugin->version = 2024120201; $plugin->release = '404.4.0'; $plugin->maturity = MATURITY_BETA; From d03467971179c71f1b51ab7ea9c02a6cc8cba88f Mon Sep 17 00:00:00 2001 From: Colin Beeby Date: Wed, 5 Feb 2025 14:04:45 +0000 Subject: [PATCH 14/18] Added deployment-dev workflow --- version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.php b/version.php index 0714e84..14c3743 100755 --- a/version.php +++ b/version.php @@ -26,7 +26,7 @@ defined('MOODLE_INTERNAL') || die(); // This is the version of the plugin. -$plugin->version = 2024120201; +$plugin->version = 2024120202; $plugin->release = '404.4.0'; $plugin->maturity = MATURITY_BETA; From 1ebf63118aa1739a0c1b35d3fcef44ab1e36f40f Mon Sep 17 00:00:00 2001 From: Colin Beeby Date: Wed, 5 Feb 2025 14:24:49 +0000 Subject: [PATCH 15/18] Added deployment-dev workflow --- .github/workflows/deployment-dev.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/deployment-dev.yml b/.github/workflows/deployment-dev.yml index 4fde31e..fe6b7c0 100644 --- a/.github/workflows/deployment-dev.yml +++ b/.github/workflows/deployment-dev.yml @@ -3,7 +3,7 @@ name: Deploy theme to moodle dev on: push: branches: - - addDeploymentWorkflow + - CI permissions: id-token: write @@ -27,7 +27,6 @@ jobs: - name: Copy files run: | - # az storage file upload-batch --account-name ${{ vars.AZURE_STORAGE_ACCOUNT }} --destination ${{ vars.AZURE_FILE_SHARE }}/nhse --source . --connection-string '${{ secrets.AZURE_STORAGE_ACCOUNT_CONNECTION_STRING }}' find . -type f \ -not -path "./.git/*" \ -not -path "./.github/*" \ From 38e554e65775086d06242b6d6852a260d953c7df Mon Sep 17 00:00:00 2001 From: Colin Beeby Date: Wed, 5 Feb 2025 14:40:33 +0000 Subject: [PATCH 16/18] Added deployment pipeline for test --- .github/workflows/deployment-test.yml | 36 +++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/deployment-test.yml diff --git a/.github/workflows/deployment-test.yml b/.github/workflows/deployment-test.yml new file mode 100644 index 0000000..374c400 --- /dev/null +++ b/.github/workflows/deployment-test.yml @@ -0,0 +1,36 @@ +name: Deploy theme to moodle dev + +on: + push: + branches: + - RC + +permissions: + id-token: write + contents: read + +jobs: + copy_files: + name: Copy files from github to Azure storage + runs-on: ubuntu-latest + environment: test + + steps: + - uses: actions/checkout@v3 + + - name: 'Az CLI login' + uses: azure/login@v1 + with: + client-id: ${{ vars.AZURE_CLIENT_ID }} + tenant-id: ${{ vars.AZURE_TENANT_ID }} + subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }} + + - name: Copy files + run: | + find . -type f \ + -not -path "./.git/*" \ + -not -path "./.github/*" \ + -not -path "./.vs/*" \ + -not -name ".gitattributes" \ + -not -name ".gitignore" \ + -exec sh -c 'az storage file upload --account-name ${{ vars.AZURE_STORAGE_ACCOUNT }} --share-name ${{ vars.AZURE_FILE_SHARE }} --source {} --path nhse/${1#./}' _ '{}' --account-key ${{ secrets.AZURE_STORAGE_ACCOUNT_KEY }} \; From 73354bccd9f72ca2e9968c9ce5543f0fe89be664 Mon Sep 17 00:00:00 2001 From: Colin Beeby Date: Thu, 6 Feb 2025 09:09:02 +0000 Subject: [PATCH 17/18] Added production Action yaml --- .github/workflows/deployment-prod.yml | 51 +++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/deployment-prod.yml diff --git a/.github/workflows/deployment-prod.yml b/.github/workflows/deployment-prod.yml new file mode 100644 index 0000000..6ed4170 --- /dev/null +++ b/.github/workflows/deployment-prod.yml @@ -0,0 +1,51 @@ +name: Deploy theme to moodle dev + +on: + workflow_dispatch: + inputs: + confirm: + description: 'Are you sure you want to proceed? Type "yes" to confirm.' + required: true + default: 'no' + +permissions: + id-token: write + contents: read + +jobs: + confirm-job: + runs-on: ubuntu-latest + environment: ProdApproval + steps: + - name: Check confirmation + run: | + if [ "${{ github.event.inputs.confirm }}" != "yes" ]; then + echo "Confirmation failed. Exiting workflow." + exit 1 + fi + echo "Confirmation successful. Proceeding..." + + copy_files: + name: Copy files from github to Azure storage + runs-on: ubuntu-latest + environment: prod + + steps: + - uses: actions/checkout@v3 + + - name: 'Az CLI login' + uses: azure/login@v1 + with: + client-id: ${{ vars.AZURE_CLIENT_ID }} + tenant-id: ${{ vars.AZURE_TENANT_ID }} + subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }} + + - name: Copy files + run: | + find . -type f \ + -not -path "./.git/*" \ + -not -path "./.github/*" \ + -not -path "./.vs/*" \ + -not -name ".gitattributes" \ + -not -name ".gitignore" \ + -exec sh -c 'az storage file upload --account-name ${{ vars.AZURE_STORAGE_ACCOUNT }} --share-name ${{ vars.AZURE_FILE_SHARE }} --source {} --path nhse/${1#./}' _ '{}' --account-key ${{ secrets.AZURE_STORAGE_ACCOUNT_KEY }} \; From b6cb7290c6f19a063fd4b24eaaadfb94d85260a7 Mon Sep 17 00:00:00 2001 From: Colin Beeby Date: Thu, 6 Feb 2025 09:27:02 +0000 Subject: [PATCH 18/18] Added production Action yaml --- .github/workflows/deployment-dev.yml | 2 +- .github/workflows/deployment-prod.yml | 2 +- .github/workflows/deployment-test.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deployment-dev.yml b/.github/workflows/deployment-dev.yml index fe6b7c0..a448583 100644 --- a/.github/workflows/deployment-dev.yml +++ b/.github/workflows/deployment-dev.yml @@ -1,4 +1,4 @@ -name: Deploy theme to moodle dev +name: Deploy theme to dev moodle on: push: diff --git a/.github/workflows/deployment-prod.yml b/.github/workflows/deployment-prod.yml index 6ed4170..906a7ad 100644 --- a/.github/workflows/deployment-prod.yml +++ b/.github/workflows/deployment-prod.yml @@ -1,4 +1,4 @@ -name: Deploy theme to moodle dev +name: Deploy theme to production moodle on: workflow_dispatch: diff --git a/.github/workflows/deployment-test.yml b/.github/workflows/deployment-test.yml index 374c400..617d502 100644 --- a/.github/workflows/deployment-test.yml +++ b/.github/workflows/deployment-test.yml @@ -1,4 +1,4 @@ -name: Deploy theme to moodle dev +name: Deploy theme to test moodle on: push: