Skip to content

Commit

Permalink
Add CI builds and publish
Browse files Browse the repository at this point in the history
  • Loading branch information
randr0id committed Feb 11, 2022
1 parent a81cf03 commit 27dfb41
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 2 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build checks

on:
push:
branches:
- '**'

jobs:
lint:
name: hadolint
runs-on: ubuntu-20.04
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Lint checks
uses: hadolint/hadolint-action@v1.6.0
with:
dockerfile: Dockerfile

build:
name: docker build
runs-on: ubuntu-20.04
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Build
run: >
docker build .
--build-arg BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
--build-arg VCS_REF=${GITHUB_SHA}
-t randr0id/android-docker:latest
-t randr0id/android-docker:${GITHUB_REF_NAME}
28 changes: 28 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publish

on:
release:
types: [released]

jobs:
publish:
name: Release build and publish
runs-on: ubuntu-20.04
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Release build
run: >
docker build .
--build-arg BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
--build-arg VCS_REF=${GITHUB_SHA}
-t randr0id/android-docker:latest
-t randr0id/android-docker:${GITHUB_REF_NAME}
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Publish to Docker Hub
run: docker push randr0id/android-docker --all-tags

1 change: 1 addition & 0 deletions .hadolint.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ignored:
- DL3008
- DL3059
- DL4006
- SC2086
- SC2154
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Android Docker Image
[![License](http://img.shields.io/badge/License-Apache%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0) [![Download](https://img.shields.io/docker/v/randr0id/android-docker?style=flat-square)](https://hub.docker.com/r/randr0id/android-docker/tags)
[![License](http://img.shields.io/badge/License-Apache%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0) [![Download](https://img.shields.io/docker/v/randr0id/android-docker?style=flat-square)](https://hub.docker.com/r/randr0id/android-docker/tags) [![Workflow](https://github.com/randr0id/android-docker/actions/workflows/build.yml/badge.svg)](https://github.com/randr0id/android-docker/actions/workflows/build.yml)

_A Docker image for building and testing Android apps._

Expand Down
1 change: 0 additions & 1 deletion packages.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
build-tools;31.0.0
platforms;android-30
platforms;android-31

0 comments on commit 27dfb41

Please sign in to comment.