From 41ec942f11dbd0b8862ba4bfe498d6f87cb6da53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1zaro=20Menezes?= Date: Tue, 20 Jun 2023 14:20:25 -0300 Subject: [PATCH] Update deployment action --- .github/workflows/deploy.yml | 42 +++++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 3ac3c0c..987372e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -9,9 +9,41 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: akhileshns/heroku-deploy@v3.4.6 + - name: Code checkout + uses: actions/checkout@v2 with: - heroku_api_key: ${{secrets.HEROKU_API_KEY}} - heroku_app_name: "br-com-lazarodm-image-api" - heroku_email: "lazarodm@gmail.com" + submodules: true + + - name: Login to ACR + uses: docker/login-action@v2 + with: + registry: ${{ secrets.REGISTRY_LOGIN_SERVER }} + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_PASSWORD }} + + - name: Build and push + uses: docker/build-push-action@v4 + with: + push: true + tags: ${{ secrets.REGISTRY_LOGIN_SERVER }}/image-api:${{ github.sha }} + + deploy: + runs-on: ubuntu-latest + needs: build + steps: + - name: 'Login to Azure' + uses: 'azure/login@v1' + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + + - name: 'Deploy to Azure Container Instances' + uses: 'azure/aci-deploy@v1' + with: + resource-group: ${{ secrets.RESOURCE_GROUP }} + dns-name-label: larazodm-image-api + image: ${{ secrets.REGISTRY_LOGIN_SERVER }}/blog:${{ github.sha }} + registry-login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }} + registry-username: ${{ secrets.REGISTRY_USERNAME }} + registry-password: ${{ secrets.REGISTRY_PASSWORD }} + name: image-api-container-group + location: 'brazil south'