|
41 | 41 | - name: Run tests |
42 | 42 | run: dotnet test |
43 | 43 |
|
44 | | - docker-build: |
| 44 | + build-docker: |
45 | 45 | runs-on: ubuntu-latest |
46 | 46 | needs: [build, test] |
47 | 47 | steps: |
@@ -111,62 +111,4 @@ jobs: |
111 | 111 | uses: azure/webapps-deploy@v2 |
112 | 112 | with: |
113 | 113 | app-name: app-as-code |
114 | | - publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} |
115 | | - package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} |
116 | | - |
117 | | - - name: Set webapp-url output |
118 | | - id: set-url |
119 | | - run: echo "webapp-url=https://app-as-code.azurewebsites.net" >> $GITHUB_OUTPUT |
120 | | - |
121 | | - deploy-docker: |
122 | | - runs-on: ubuntu-latest |
123 | | - needs: [docker-build] |
124 | | - environment: |
125 | | - name: production |
126 | | - outputs: |
127 | | - webapp-url: ${{ steps.set-url.outputs.webapp-url }} |
128 | | - steps: |
129 | | - - name: Deploy to Azure Web App with Docker |
130 | | - id: deploy-to-webapp |
131 | | - uses: azure/webapps-deploy@v2 |
132 | | - with: |
133 | | - app-name: fefezfezf |
134 | | - slot-name: production |
135 | | - publish-profile: ${{ secrets.AzureAppService_PublishProfile_9b585dbfa0374924ab161fec5b2dea00 }} |
136 | | - images: forsanta/webapi-starter-dotnet8:${{ github.sha }} |
137 | | - |
138 | | - - name: Set webapp-url output |
139 | | - id: set-url |
140 | | - run: echo "webapp-url=https://fefezfezf.azurewebsites.net" >> $GITHUB_OUTPUT |
141 | | - |
142 | | - check-url-docker: |
143 | | - runs-on: ubuntu-latest |
144 | | - needs: deploy-docker |
145 | | - steps: |
146 | | - - name: Vérifier que l’URL retourne la valeur attendue |
147 | | - run: | |
148 | | - url="${{ needs.deploy-docker.outputs.webapp-url }}" |
149 | | - echo "Test de l'URL : $url" |
150 | | - response=$(curl -s "$url") |
151 | | - echo "Réponse : $response" |
152 | | - if [ "$response" != "$EXPECTED_RESPONSE" ]; then |
153 | | - echo "❌ L'URL ne retourne pas '$EXPECTED_RESPONSE'" |
154 | | - exit 1 |
155 | | - fi |
156 | | - echo "✅ L'URL retourne bien '$EXPECTED_RESPONSE'" |
157 | | -
|
158 | | - check-url-binary: |
159 | | - runs-on: ubuntu-latest |
160 | | - needs: deploy-binary |
161 | | - steps: |
162 | | - - name: Vérifier que l’URL retourne la valeur attendue |
163 | | - run: | |
164 | | - url="${{ needs.deploy-binary.outputs.webapp-url }}" |
165 | | - echo "Test de l'URL : $url" |
166 | | - response=$(curl -s "$url") |
167 | | - echo "Réponse : $response" |
168 | | - if [ "$response" != "$EXPECTED_RESPONSE" ]; then |
169 | | - echo "❌ L'URL ne retourne pas '$EXPECTED_RESPONSE'" |
170 | | - exit 1 |
171 | | - fi |
172 | | - echo "✅ L'URL retourne bien '$EXPECTED_RESPONSE'" |
| 114 | + publish-profi |
0 commit comments