deploy to app service using acr #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy App to Azure App Service | |
on: | |
push: | |
branches: | |
- deploy-to-azure-app-service-with-acr | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Source | |
uses: actions/checkout@v3 | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Build Project | |
run: mvn clean install -DskipTests | |
- name: Login to Azure Container Registry | |
uses: azure/docker-login@v1 | |
with: | |
login-server: integrationninjas.azurecr.io | |
username: ${{ secrets.AZURE_REGISTRY_USERNAME }} | |
password: ${{ secrets.AZURE_REGISTRY_PASSWORD }} | |
- name: Build, tag and push image to Azure Container Registry | |
run: | | |
docker build -t integrationninjas.azurecr.io/integrationNinjas:${{ github.sha }} . | |
docker push integrationninjas.azurecr.io/integrationNinjas:${{ github.sha }} | |
- name: Deploy to Azure App Service | |
uses: azure/webapps-deploy@v2 | |
with: | |
app-name: springboot-app-test | |
publish-profile: ${{ secrets.azureWebAppPublishProfile }} | |
images: integrationninjas.azurecr.io/integrationNinjas:${{ github.sha }} |