Github操作将Docker部署到AWS ECS ECR

嗨,我想使用Github操作来构建并将github存储库的前端和后端映像推送到AWS ECR。

如何更改Github操作的这部分配置?

- name: Build,tag,and push image to Amazon ECR
  id: build-image
  env:
    ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
    ECR_REPOSITORY: githubactions
    IMAGE_TAG: latest
  run: |
    # Build a docker container and
    # push it to ECR so that it can
    # be deployed to ECS.
    docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
    docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
    echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"

可以说,在我的Github存储库中,我有两个带有web / Dockerfile和backend / Dockerfile的映像

zdedu 回答:Github操作将Docker部署到AWS ECS ECR

您只需要使用||并运行一次build + push命令两次,即可在同一步骤中将其作为其他命令:

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
    foreach (var property in modelBuilder.Model.GetEntityTypes()
        .SelectMany(t => t.GetProperties()).Where(p => p.ClrType == typeof(string)))
    {
        if (property.GetMaxLength() == null)
        {
            property.SetMaxLength(256);
        }

        if (string.IsNullOrEmpty(property.GetColumnType()))
        {
            property.SetColumnType("varchar");
        }
    }
}

或两个单独的步骤:

// inputs

timeUnit = 15 min
rangeStart = 17:30:00
rangeEnd = 18:30:00

// algorithm
discreteTimes = toDiscreteTimes(rangeStart,rangeEnd,timeUnit) // calculate discrete times between rangeStart and rangeEnd,so in your case 17:30,17:45,...,18:30

query = "..." // up to the start of your case statements
for (i = 1; i < discreteTimes.maxIndex; i++) {
    query += caseStatement(discreteTimes[i-1],discreteTimes[i]) // generate your case statement with these two times
}

query += "..." // the rest of the query after the case statements
本文链接:https://www.f2er.com/2431351.html

大家都在问