Prerequisites
- GitHub account
- Microsoft Azure account
- Windsurf CLI installed
- Node.js and npm
1. GitHub Repository Setup
- Create a new repository on GitHub
- Clone the repository locally
- Initialize your Windsurf project in the repository
A comprehensive guide to setting up CI/CD with GitHub Actions and Azure
Seamlessly integrate GitHub & Azure for efficient deployment. This comprehensive guide will help you set up and optimize your Windsurf development environment with automated CI/CD pipelines.
Set up branch protection for your main branch:
main
branchCreate .github/workflows/windsurf-ci.yml
:
name: Windsurf CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '16.x'
- name: Install Dependencies
run: npm ci
- name: Run Build
run: npm run build
- name: Run Tests
run: npm test
Add these secrets to your GitHub repository:
AZURE_CREDENTIALS
- Azure service principal credentialsAZURE_WEBAPP_NAME
- Your Azure Web App nameAZURE_RESOURCE_GROUP
- Azure resource group nameAdd these to your Azure Web App Configuration:
NODE_ENV
- Set to 'production'WEBSITE_NODE_DEFAULT_VERSION
- ~16SCM_DO_BUILD_DURING_DEPLOYMENT
- 1Your GitHub Actions workflow will automatically:
Solution: Check GitHub Actions logs for specific error messages. Common issues include missing dependencies or test failures.
Solution: Verify GitHub repository settings and Azure deployment center configuration.
Solution: Ensure variables are set in Azure Application Settings and that the app restarts after changes.