Azure Static Web Apps. For bugs and feature requests, please create an issue in this repo. For community discussions, latest updates, kindly refer to the Discussions Tab. To know what's new in Static Web Apps, visit https://aka.ms/swa/ThisMonth
I'm using Gatsby for my SWA, and attempting to upgrade from Gatsby v4 to v5. As a part of the upgrade, I need to also update NODE to 18. All works well locally, but when attempting deployment via Github action, it fails with PYTHON error. I've tried with different versions of Python. It works fine when using Oryx with NODE 14 AND Gatsby4.
GitHub Actions or Azure Pipelines workflow YAML file
name: Azure Static Web Apps CI/CD
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- main
schedule:
- cron: '0 1 * * 1,3,5'
jobs:
build_and_deploy_job:
if: github.event_name == 'schedule' || github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-22.04 ####ALSO TRIED WITH 18.04
name: Build and Deploy Job
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Setup Python
uses: actions/setup-python@v2 ####I ADDED THIS ONLY FOR THIS, EARLIER WITH NODE 14 AND GATSBY4 i DIDN'T HAVE THIS AT ALL
with:
# Version range or exact version of a Python version to use, using SemVer's version range syntax.
python-version: "3.9.x" ####ALSO TRIED WITH 2.7.x, SAME ERROR ALSO WITHOUT THIS
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_ICY_SEA_XYZXYZ }}
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 you app requirements. ######
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
app_location: "/" # App source code path
api_location: "" # Api source code path - optional
output_location: "public" # Built app content directory - optional
env:
AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.AZURE_STORAGE_CONNECTION_STRING }}
NPM_CONFIG_LEGACY_PEER_DEPS: true ####THIS I ADDED AS A TEST DURING GATSBY5 UPDATE, NOT USING IT EARLIER
###### 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_STATIC_WEB_APPS_API_TOKEN_ICY_SEA_XYZXYZ }}
action: "close"
I'm using Gatsby for my SWA, and attempting to upgrade from Gatsby v4 to v5. As a part of the upgrade, I need to also update NODE to 18. All works well locally, but when attempting deployment via Github action, it fails with PYTHON error. I've tried with different versions of Python. It works fine when using Oryx with NODE 14 AND Gatsby4.
GitHub Actions or Azure Pipelines workflow YAML file
staticwebapp.config.json file
Source repo not public
package.json has this:
Expected behavior Build would succeed.