File tree Expand file tree Collapse file tree 1 file changed +13
-17
lines changed
Expand file tree Collapse file tree 1 file changed +13
-17
lines changed Original file line number Diff line number Diff line change 1-
1+ # yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
22name : CI/CD
33
44on :
55 push :
6- branches : [ main ]
6+ branches : [ " main" ]
77 pull_request :
8- branches : [ main ]
8+ branches : [ " main" ]
99
1010permissions :
1111 contents : read
3333 - name : Run tests
3434 run : pytest -q
3535
36- # --- Optional: SonarCloud (uncomment to enable) ---
37- # - name: SonarCloud Scan
38- # if: ${{ github.event_name != 'pull_request' }}
39- # uses: SonarSource/sonarcloud-github-action@master
40- # env:
41- # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
42- # with:
43- # args: >
44- # -Dsonar.projectKey=${{ vars.SONAR_PROJECT_KEY }}
45- # -Dsonar.organization=${{ vars.SONAR_ORG }}
46- # -Dsonar.python.version=3.11
47-
48- # --- Optional: Deploy to Azure Web App (manual approval via env) ---
4936 deploy :
5037 needs : build-test
5138 runs-on : ubuntu-latest
@@ -54,10 +41,19 @@ jobs:
5441 - name : Checkout
5542 uses : actions/checkout@v4
5643
44+ # Sanity check: ensures secret/variable exist at runtime
45+ - name : Check contexts
46+ run : |
47+ echo "AZURE_WEBAPP_NAME=${{ vars.AZURE_WEBAPP_NAME }}"
48+ if [ -z "${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}" ]; then
49+ echo "❌ Missing AZURE_WEBAPP_PUBLISH_PROFILE secret"; exit 1
50+ else
51+ echo "✅ Publish profile secret present"
52+ fi
53+
5754 - name : Azure WebApp Deploy
5855 uses : azure/webapps-deploy@v3
5956 with :
6057 app-name : ${{ vars.AZURE_WEBAPP_NAME }}
6158 publish-profile : ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
6259 package : .
63-
You can’t perform that action at this time.
0 commit comments