Skip to content

Update README.md

Update README.md #42

name: Azure Static Web Apps CI/CD
on:
push:
branches:
- github # Changed from 'main' to standard branch name
pull_request:
branches:
- github # Changed from 'main' to standard branch name
jobs:
build_and_deploy_job:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
name: Build and Deploy Job
permissions:
id-token: write # Required for OIDC authentication
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4 # Updated to latest version
with:
submodules: true
lfs: false
- name: Login to Azure
uses: azure/login@v2 # Proper OIDC authentication
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Build And Deploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Added for better integration
action: "upload"
app_location: "/"
api_location: "api"
output_location: "build" # Changed to standard output folder
app_build_command: "npm run build" # Added build command
skip_app_build: false
skip_api_build: false
build_timeout_in_minutes: 30 # Reduced timeout to 15 mins
env:
NODE_ENV: production

Check failure on line 47 in .github/workflows/azure-static-web-apps-witty-pond-0e2ac5d0f.yml

View workflow run for this annotation

GitHub Actions / Azure Static Web Apps CI/CD

Invalid workflow file

The workflow is not valid. .github/workflows/azure-static-web-apps-witty-pond-0e2ac5d0f.yml (Line: 47, Col: 13): A mapping was not expected
close_pull_request_job:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
name: Close Pull Request Job
permissions:
id-token: write
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Close Environment
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_WITTY_POND_0E2AC5D0F }}
action: "close"
repo_token: ${{ secrets.GITHUB_TOKEN }}