Sign inSign up

devbymegha/androidci

By devbymegha

•Updated 4 months ago

Image
3

199

devbymegha/androidci repository overview

⁠Android CI Docker Image šŸš€

devbymegha/androidci:latest

Android SDK Docker image for CI/CD builds with GitLab CI and GitHub Actions.

Supports Android app builds, APK/AAB generation, Gradle caching, and multi-version Android SDK support.

⁠Features

āœ… Android SDK API 24 → 36
āœ… Java 17
āœ… Gradle support
āœ… APK / AAB builds
āœ… GitLab CI support
āœ… GitHub Actions support
āœ… Gradle caching enabled
āœ… Intel + ARM64 (Apple Silicon M1/M2/M3)


⁠Pull Image

docker pull devbymegha/androidci:latest

⁠Run Locally

Build Android app:

docker run --rm \
-v "$PWD:/workspace" \
-w /workspace \
devbymegha/androidci:latest \
./gradlew assembleDebug

Release build:

docker run --rm \
-v "$PWD:/workspace" \
-w /workspace \
devbymegha/androidci:latest \
./gradlew assembleRelease

⁠Installed Components

ComponentVersion
Ubuntu24.04
Java17
Android SDKAPI 24 → 36
Build Tools30.0.3 / 33.0.2 / 34.0.0 / 35.0.0

⁠GitLab CI Example

Create .gitlab-ci.yml in the root of your Android project:

image: devbymegha/androidci:latest

stages:
  - build

variables:
  GRADLE_OPTS: "-Dorg.gradle.daemon=false"

before_script:
  # Make Gradle executable
  - chmod +x ./gradlew

  # Enable local Gradle cache
  - export GRADLE_USER_HOME="$(pwd)/.gradle"

cache:
  key: ${CI_PROJECT_ID}

  paths:
    - .gradle/

build-debug:

  stage: build

  script:
    # Clean previous builds
    - ./gradlew clean

    # Generate debug APK
    - ./gradlew assembleDebug

  artifacts:

    name: "debug-apk-${CI_COMMIT_SHORT_SHA}"

    expire_in: 2 weeks

    paths:
      - app/build/outputs/apk/debug/app-debug.apk

Push code:

git add .
git commit -m "setup gitlab ci"
git push

GitLab automatically starts the build and generates APK artifacts.


⁠GitHub Actions Example

Create:

.github/workflows/android-ci.yml

name: Android CI

on:
  push:

  pull_request:

jobs:

  build:

    runs-on: ubuntu-latest

    container:
      image: devbymegha/androidci:latest

    env:
      GRADLE_USER_HOME: ${{ github.workspace }}/.gradle

    steps:

      - name: Checkout Project
        uses: actions/checkout@v4

      - name: Cache Gradle

        uses: actions/cache@v4

        with:
          path: ${{ github.workspace }}/.gradle

          key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*','**/gradle-wrapper.properties') }}

      - name: Give execute permission

        run: chmod +x gradlew

      - name: Clean build

        run: ./gradlew clean

      - name: Build APK

        run: ./gradlew assembleDebug

      - name: Upload APK

        uses: actions/upload-artifact@v4

        with:
          name: app-debug-apk

          path: app/build/outputs/apk/debug/app-debug.apk

Push code:

git add .
git commit -m "setup github action"
git push

GitHub Actions → Actions tab → APK artifact available after build completes.

Tag summary

Content type

Image

Digest

sha256:9239a4e57…

Size

1.4 GB

Last updated

4 months ago

docker pull devbymegha/androidci