subosito / flutter-action

Flutter environment for use in GitHub Actions. It works on Linux, Windows, and macOS.
MIT License
2.23k stars 199 forks source link

flutter-action job fails when I use a private container #96

Closed HRahimy closed 3 years ago

HRahimy commented 3 years ago

Container registry setup

I use the following Dockerfile to create an image that I then push to google cloud container registry as a private image. I want to run my CD workflow in my workflow so that I can fetch deployment credentials that I store within my image.

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.

FROM ubuntu:latest

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

Workflow configuration

Following is the contents of my workflow configuration in .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'

      # [ ... ]

Error occured :(

But I keep getting this error:

Full logs available here

image

yurikoles commented 3 years ago

Duplicate of #72

HRahimy commented 3 years ago

Thank you @yurikoles. I'll close this, and what I learned from #72 solved my problem.

I just updated my Dockerfile like so and it solved the problem:


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/