From e2bed266911f82ad3f633a8fba5b3aa870f6f385 Mon Sep 17 00:00:00 2001 From: AGC <158510532+AlvaroGlezC@users.noreply.github.com> Date: Fri, 10 May 2024 20:16:03 +0200 Subject: [PATCH] Update build.yml --- .github/workflows/build.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2b751ca..7fb9c7e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -89,3 +89,25 @@ jobs: uses: sonarsource/sonarcloud-github-action@master env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + + deployment: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Login to Azure Container Registry + uses: azure/docker-login@v1 + with: + login-server: ${{ secrets.AZURE_REGISTRY_NAME }}.azurecr.io + username: ${{ secrets.AZURE_REGISTRY_USERNAME }} + password: ${{ secrets.AZURE_REGISTRY_PASSWORD }} + + - name: Delete images + - run: | + az login --service-principal -u ${{ secrets.AZURE_REGISTRY_USERNAME }} -p ${{ secrets.AZURE_REGISTRY_PASSWORD }} + az acr login --name ${{ secrets.AZURE_REGISTRY_NAME }} + - run: az acr repository delete --name ${{ secrets.AZURE_REGISTRY_NAME }} --repository syg-docker-db --yes + + - name: Push images + - run: docker build -f ../../docker/database-mysql.Dockerfile -t ${{ secrets.AZURE_REGISTRY_NAME }}.azurecr.io/syg-docker-db:0.1.0-SNAPSHOT ../../docker + - run: docker push ${{ secrets.AZURE_REGISTRY_NAME }}.azurecr.io/syg-docker-db:0.1.0-SNAPSHOT