Skip to content

Create main.yml

Create main.yml #4

Workflow file for this run

name: Deploy to Azure App Service
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
- name: Install Composer dependencies
run: composer install --no-interaction --prefer-dist
- name: Build the application
run: cp .env.example .env
- name: Deploy to Azure App Service
uses: azure/webapps-deploy@v2
with:
app-name: <Your-App-Service-Name>
slot-name: <Your-Deployment-Slot-Name> # Optional: If using deployment slots
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}