GitHub 当我使用私有容器时,动作 flutter-action 作业失败

GitHub Actions flutter-action job fails when I use a private container

容器注册表设置

我使用以下 Dockerfile 创建一个映像,然后将其作为私有映像推送到 google 云容器注册表。我想 运行 我的工作流程中的 CD 工作流程,以便我可以获取存储在我的映像中的部署凭据。

Side Note: Not sure if this is the safest method to be managing sensitive files such as .jks files I need to deploy my app to play store. I'd appreciate it if anyone could shed some light on this as well (Not sure if I should move this side note to a different SO question).

FROM ubuntu:latest

COPY Gemfile .
COPY Gemfile.lock .
COPY fastlane/ ./fastlane/

工作流配置

以下是我在.github/workflows/main.yml中的工作流配置内容。 See here for complete file.

# This is a basic workflow to help you get started with Actions

# [ ... ]

jobs:
  build:
    runs-on: ubuntu-latest

    container:
      image: gcr.io/positive-affirmations-313800/droid-deploy-env:latest
      credentials:
        username: _json_key
        password: ${{ secrets.GCR_JSON_KEY }}

    steps:
      - uses: actions/checkout@v2
        working-directory: $HOME

      - uses: actions/setup-java@v1
        working-directory: $HOME
        with:
          java-version: '12.x'

      - uses: subosito/flutter-action@v1
        working-directory: $HOME
        with:
          flutter-version: '2.0.5'

      # [ ... ]

发生错误:(

但是我一直收到这个错误:

Full logs available here

我找到了问题的解决方案。

我只是在我的容器上缺少 xz-utils,所以我更新了我的 docker 图像来安装它

Referenced from the related github issue here

FROM ubuntu:latest

RUN apt-get update && apt-get install -y \
  xz-utils \
  git \
  android-sdk \
  && rm -rf /var/lib/apt/lists/*

COPY Gemfile .
COPY Gemfile.lock .
COPY fastlane/ ./fastlane/