Deploy Gatsby to Azure Static Web Apps
Simple GitHub Actions workflow to build and deploy Gatsby to Azure Static Web Apps
# .github/workflows/build-and-deploy-to-azure-static-web-apps.ymlname: Build and deploy Gatsby to Azure Static Web appson:push:branches:- mainenv:NODE_VERSION: 12.x # Set Node.js version to use.jobs:build:runs-on: ubuntu-lateststeps:- name: Checkout the latest source code from ${{ github.sha }} commituses: actions/checkout@v2 # https://github.com/actions/checkout- name: Use Node.js version ${{ env.NODE_VERSION }}uses: actions/setup-node@v2 # https://github.com/actions/setup-nodewith:node-version: ${{ env.NODE_VERSION }}- name: Build Gatsby site to a public folder# Yarn's already installed on a virtual environment# https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md#package-managementrun: |yarn installyarn run build- name: Deploy Gatsby to Azure Static Web Appsuses: Azure/static-web-apps-deploy@v1with:azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}action: uploadapp_location: '/' # Location of your application codeoutput_location: public # Location of the build output directory relative to the app_location.
Useful resources
Loading comments...