Create main.yml #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |