diff --git a/.github/workflows/deployment-dev.yml b/.github/workflows/deployment-dev.yml new file mode 100644 index 0000000..a448583 --- /dev/null +++ b/.github/workflows/deployment-dev.yml @@ -0,0 +1,36 @@ +name: Deploy theme to dev moodle + +on: + push: + branches: + - CI + +permissions: + id-token: write + contents: read + +jobs: + copy_files: + name: Copy files from github to Azure storage + runs-on: ubuntu-latest + environment: dev + + 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 }} \; diff --git a/.github/workflows/deployment-prod.yml b/.github/workflows/deployment-prod.yml new file mode 100644 index 0000000..906a7ad --- /dev/null +++ b/.github/workflows/deployment-prod.yml @@ -0,0 +1,51 @@ +name: Deploy theme to production moodle + +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 }} \; diff --git a/.github/workflows/deployment-test.yml b/.github/workflows/deployment-test.yml new file mode 100644 index 0000000..617d502 --- /dev/null +++ b/.github/workflows/deployment-test.yml @@ -0,0 +1,36 @@ +name: Deploy theme to test moodle + +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 }} \; 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 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;