diff --git a/.github/workflows/scale-down.yml b/.github/workflows/scale-down.yml new file mode 100644 index 00000000..e247aee3 --- /dev/null +++ b/.github/workflows/scale-down.yml @@ -0,0 +1,22 @@ +name: Scale down app service plan + +on: + schedule: + - cron: "05 19 * * 1-5" + +jobs: + build: + runs-on: ubuntu-22.04 + environment: dev + + steps: + - name: Azure Login + uses: azure/login@v1 + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + - name: Downscale outside hours + uses: azure/CLI@v1 + with: + azcliversion: 2.42.0 + inlineScript: | + az appservice plan update --resource-group ${{ vars.AZURE_RESOURCE_GROUP }} --name ${{ vars.AZURE_APPSERVICE_PLAN_NAME }} --sku B1 diff --git a/.github/workflows/scale-up.yml b/.github/workflows/scale-up.yml new file mode 100644 index 00000000..77e8ae90 --- /dev/null +++ b/.github/workflows/scale-up.yml @@ -0,0 +1,23 @@ +name: Scale up app service plan + +on: + schedule: + - cron: "0 19 * * 1-5" + +jobs: + build: + runs-on: ubuntu-22.04 + environment: dev + + steps: + - name: Azure Login + uses: azure/login@v1 + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + + - name: Upscale in hours + uses: azure/CLI@v1 + with: + azcliversion: 2.42.0 + inlineScript: | + az appservice plan update --resource-group ${{ vars.AZURE_RESOURCE_GROUP }} --name ${{ vars.AZURE_APPSERVICE_PLAN_NAME }} --sku B2