Azure Static Web Apps - Limit 104857600 bytes - Why?
I am trying to deploy a Retype app to Azure Static Web Apps using GitHub Actions. Retype is a tool that generates websites from Markdown files. However, I get the following error during the deployment:
The size of the function content was too large. The limit for this Static Web App is 104857600 bytes.
I checked the size of my wwwroot
folder, which contains the output of the Retype build, and it is about 50 MB (according to Windows Explorer). Also, the whole repo (in WinEx) is 90 MB.
I also checked the quotas for Azure Static Web Apps, and it says that the maximum size per app is 250 MB for the Standard plan, which I am using.
So, I have two questions:
- Am I correct in assuming that I should be able to create a Static Web App with a size of 250 MB like the documentation quota describes? Or, is there something that I am missing or misunderstanding that causes the quota to be lower and I can really only use 100 MB as my error describes?
- If I should be able to use 250 MB, how can I achieve this?
I have tried some of the solutions suggested in these links, such as removing the cache folder or using a bundler, but they did not work for me. Also, I'm unsure how to apply 'solutions' that are for Next.js, since my page (Retype built) doesn't use this. 1 2 3
.github/workflows
code
I have two .yml
files in the workflows folder. Below are the two files and some of their code.
retype-action.yml
build_and_deploy_job:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
needs: publish
name: Build and Deploy to Azure Static Web Apps
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.[AZURE SECRET] }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e., PR comments)
action: "upload"
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
app_location: "/wwwroot/" # App source code path
api_location: "/" # Api source code path - optional
output_location: "" # Built app content directory - optional
app_build_command: 'npm run build-ui-prod'
api_build_command: 'npm run build-api-prod'
###### End of Repository/Build Configurations ######
close_pull_request_job:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
name: Close Pull Request Job
steps:
- name: Close Pull Request
id: closepullrequest
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.[AZURE SECRET] }}
action: "close"
azure...[secret].yml
name: Azure Static Web Apps CI/CD
on:
workflow_dispatch:
push:
branches:
- published
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- published
jobs:
build_and_deploy_job:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
name: Build and Deploy Job
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.[AZURE SECRET] }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e., PR comments)
action: "upload"
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
app_location: "/wwwroot/" # App source code path
api_location: "/" # Api source code path - optional
output_location: "" # Built app content directory - optional
app_build_command: 'npm run build-ui-prod'
api_build_command: 'npm run build-api-prod'
###### End of Repository/Build Configurations ######
close_pull_request_job:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
name: Close Pull Request Job
steps:
- name: Close Pull Request
id: closepullrequest
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.[AZURE SECRET] }}
action: "close"
In link 1 above, the app and api build commands were suggested as a solution, but this didn't work. The suggestion was:
app_build_command: 'npm run build'
api_build_command: 'rm -rf ./node_modules/@next/swc-* && rm -rf ./.next/cache'