Skip to content

Commit

Permalink
deploy to app service using acr
Browse files Browse the repository at this point in the history
  • Loading branch information
integrationninjas committed Dec 20, 2023
1 parent 9348444 commit d09ac57
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
27 changes: 12 additions & 15 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: Deploy App to Azure App Service
on:
push:
branches:
- deploy-to-azure-app-service
- deploy-to-azure-app-service-with-acr

jobs:
build:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Source
Expand All @@ -18,22 +18,19 @@ jobs:
java-version: '17'
- name: Build Project
run: mvn clean install -DskipTests
- name: Upload Artifacct for deployment job
uses: actions/upload-artifact@v2
- name: Login to Azure Container Registry
uses: azure/docker-login@v1
with:
name: springboot-example
path: ${{ github.workspace }}/target/*.jar
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download Artifact from build job
uses: actions/download-artifact@v2
with:
name: springboot-example
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 }}
package: '*.jar'
images: integrationninjas.azurecr.io/integrationNinjas:${{ github.sha }}
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM eclipse-temurin:17-jdk-alpine
WORKDIR /app
COPY target/springboot-example.jar springboot-example.jar
EXPOSE 8080
CMD ["java","-jar","springboot-example.jar"]

0 comments on commit d09ac57

Please sign in to comment.