diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..b95ec38 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,36 @@ +name: Azure Static Web Apps CI/CD + +on: + push: + branches: + - main # or your default branch + workflow_dispatch: + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + name: Build and Deploy Job + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '18' + + - name: Install dependencies + run: npm install + + - name: Build project + run: npm run build + + - name: Deploy to Azure Static Web App + 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 }} + action: "upload" + app_location: "." # Location of your React app ('.' if it's in root) + output_location: "build" # 'build' for CRA, 'dist' for Vite