Spaces:
Sleeping
Sleeping
Download .github/workflows/Azure_CICD.yml from SkinCancerDiagnosis/Translator_API: direct link, hf CLI and curl.
- Browser
- Download file 1.34 kB
-
https://huggingface.co/spaces/SkinCancerDiagnosis/Translator_API/resolve/main/.github/workflows/Azure_CICD.yml
- Command line
-
hf download hf://spaces/SkinCancerDiagnosis/Translator_API/.github/workflows/Azure_CICD.yml
-
curl -L -o Azure_CICD.yml https://huggingface.co/spaces/SkinCancerDiagnosis/Translator_API/resolve/main/.github/workflows/Azure_CICD.yml
1.34 kB
| name: Build & Deploy to Azure Container Apps | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Azure Login | |
| uses: azure/login@v1 | |
| with: | |
| creds: ${{ secrets.AZURE_CREDENTIALS }} | |
| # - name: Login to Azure | |
| # uses: azure/login@v1 | |
| # with: | |
| # client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
| # tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
| # subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
| # client-secret: ${{ secrets.AZURE_CLIENT_SECRET }} | |
| - name: Build Docker image | |
| run: | | |
| docker build -t ${{ secrets.ACR_LOGIN_SERVER }}/translator-app:latest . | |
| - name: Login to Azure Container Registry | |
| run: | | |
| az acr login --name ${{ secrets.ACR_NAME }} | |
| - name: Push Docker image to ACR | |
| run: | | |
| docker push ${{ secrets.ACR_LOGIN_SERVER }}/translator-app:latest | |
| - name: Deploy updated image to Azure Container App | |
| run: | | |
| az containerapp update \ | |
| --name ${{ secrets.CONTAINER_APP_NAME }} \ | |
| --resource-group ${{ secrets.RESOURCE_GROUP }} \ | |
| --image ${{ secrets.ACR_LOGIN_SERVER }}/translator-app:latest \ | |
| --set-env-vars HF_TOKEN=${{ secrets.HF_TOKEN }} | |