Skip to content

Commit

Permalink
Update build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvaroGlezC authored May 10, 2024
1 parent adafd2d commit e2bed26
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit e2bed26

Please sign in to comment.