diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index e978e5a..5faeb1b 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -6,16 +6,16 @@ on: - main env: - AZURE_WEBAPP_NAMES: ${{ secrets.AZURE_WEBAPP_NAMES }} AZURE_WEBAPP_SHARED_LIBS_PATH: "libs" AZURE_WEBAPP_SERVICE_PATHS: "test-service,app-service" - AZURE_WEBAPP_PUBLISH_PROFILES: ${{ secrets.PUBLISH_PROFILE }},${{ secrets.APP_PUBLISH_PROFILE }} jobs: build-and-deploy: strategy: matrix: - service: ${{ fromJson(env.AZURE_WEBAPP_NAMES) }} + service: + names: [${{ secrets.AZURE_WEBAPP_NAMES }}] + publish_profiles: [${{ secrets.PUBLISH_PROFILE }}, ${{ secrets.APP_PUBLISH_PROFILE }}] runs-on: ubuntu-latest steps: @@ -34,13 +34,13 @@ jobs: run: | mkdir -p deployment_packages cp -r $AZURE_WEBAPP_SHARED_LIBS_PATH/* deployment_packages/ - cp -r ${{fromJson(env.AZURE_WEBAPP_SERVICE_PATHS)[matrix.service]}}/* deployment_packages/ - cd deployment_packages && zip -r ../${{matrix.service}}.zip . -x '*.git*' && cd .. + cp -r ${{ matrix.service.names }}/* deployment_packages/ + cd deployment_packages && zip -r ../${{ matrix.service.names }}.zip . -x '*.git*' && cd .. working-directory: ${{ github.workspace }} - name: Deploy to Azure uses: azure/webapps-deploy@v2 with: - app-name: ${{matrix.service}} - publish-profile: ${{fromJson(env.AZURE_WEBAPP_PUBLISH_PROFILES)[matrix.service]}} - package: ${{ github.workspace }}/${{matrix.service}}.zip + app-name: ${{ matrix.service.names }} + publish-profile: ${{ matrix.service.publish_profiles }} + package: ${{ github.workspace }}/${{ matrix.service.names }}.zip