使用github操作部署到azure函数需要很长时间

nhn9ugyo  于 2021-07-23  发布在  Java
关注(0)|答案(0)|浏览(298)

我想知道为什么使用官方的azure函数github操作部署一个容器映像要花这么长时间,而它基本上只是从注册表下载映像。部署时间是构建时间的两倍。

这就是我的github工作流的样子。我只是建立 Spring 启动映像和上传它,这一切不需要很长时间。

name: Build and deploy native image
on:
  push:
    branches:
      - master
jobs:
  build-and-deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Install GraalVM
        uses: DeLaGuardo/setup-graalvm@3.0
        with:
          graalvm-version: '21.0.0.java11'

      - name: Cache local Maven repository
        uses: actions/cache@v2
        with:
          path: ~/.m2/repository
          key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
          restore-keys: |
            ${{ runner.os }}-maven-

      - name: Test GraalVM installation
        run: java -version

      - name: Install native-image
        run: |
          echo
          gu install native-image

      - name: Check Docker installation
        run: |
          echo
          docker version

      - name: Build native image
        run: ./gradlew bootBuildImage

      - name: Login via Azure CLI
        uses: azure/login@v1
        with:
          creds: ${{ secrets.AZURE_CREDENTIALS }}

      - name: Docker Login
        uses: azure/docker-login@v1
        with:
          username: ${{ secrets.REGISTRY_USERNAME }}
          password: ${{ secrets.REGISTRY_PASSWORD }}

      - name: Upload Docker image to registry
        run: docker push itsandreramon/tempory-azure-functions:latest

      - name: Deploy to Azure Function
        uses: Azure/functions-container-action@v1
        with:
          app-name: ${{ secrets.AZ_FUNCTION_NAME_APP }}
          image: itsandreramon/tempory-azure-functions:latest

      - name: Azure logout
        run: |
          az logout

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题