Skip to content

Commit 5919bce

Browse files
committed
ci: add schema + context check + deploy
1 parent 9a79c26 commit 5919bce

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

.github/workflows/ci-cd.yml

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
1+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
22
name: CI/CD
33

44
on:
55
push:
6-
branches: [ main ]
6+
branches: [ "main" ]
77
pull_request:
8-
branches: [ main ]
8+
branches: [ "main" ]
99

1010
permissions:
1111
contents: read
@@ -33,19 +33,6 @@ jobs:
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-

0 commit comments

Comments
 (0)