Skip to content

Commit 2431a97

Browse files
committed
publish on release and add github workflow badge
1 parent c85fb53 commit 2431a97

File tree

5 files changed

+50
-13
lines changed

5 files changed

+50
-13
lines changed
File renamed without changes.

.github/workflows/build.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Build Docker image
2+
3+
on:
4+
push: &paths
5+
paths:
6+
- Dockerfile
7+
pull_request:
8+
<<: *paths
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-20.04
13+
env:
14+
IMAGE_TAG: react-native
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v2
18+
19+
- name: Build Docker image
20+
run: docker build --tag $IMAGE_TAG .
21+
22+
- name: Checkout React Native
23+
uses: actions/checkout@v2
24+
with:
25+
repository: facebook/react-native
26+
path: react-native
27+
28+
- name: Build React Native
29+
run: |
30+
docker run --rm -v "${GITHUB_WORKSPACE}/react-native/":/pwd -w /pwd $IMAGE_TAG /bin/sh -c \
31+
"yarn install && ./gradlew --no-daemon :packages:rn-tester:android:app:assembleRelease && ./scripts/circleci/buck_fetch.sh"

.github/workflows/publish.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
1-
name: Publish Docker image
1+
name: Publish
22
on:
3-
push:
4-
branches:
5-
- master
63
release:
74
types: [published]
85

96
jobs:
107
push_to_registry:
118
name: Push Docker image to Docker Hub
12-
runs-on: ubuntu-latest
9+
runs-on: ubuntu-20.04
1310
steps:
1411
- name: Check out the repo
1512
uses: actions/checkout@v2
16-
- name: Push to Docker Hub
17-
uses: docker/build-push-action@v1
13+
14+
- name: Set up Docker Buildx
15+
uses: docker/setup-buildx-action@v1
16+
17+
- name: Login to DockerHub
18+
uses: docker/login-action@v1
1819
with:
1920
username: ${{ secrets.DOCKER_USERNAME }}
2021
password: ${{ secrets.DOCKER_PASSWORD }}
21-
repository: reactnativecommunity/react-native-android
22-
tag_with_ref: true
23-
tags: latest
22+
23+
- name: Push to Docker Hub
24+
uses: docker/build-push-action@v2
25+
with:
26+
push: true
27+
tags: |
28+
reactnativecommunity/react-native-android:latest
29+
reactnativecommunity/react-native-android:${{ GITHUB_REF }}

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ LABEL Description="This image provides a base Android development environment fo
55
ENV DEBIAN_FRONTEND=noninteractive
66

77
# set default build arguments
8-
ARG SDK_VERSION=commandlinetools-linux-6514223_latest.zip
8+
ARG SDK_VERSION=commandlinetools-linux-6609375_latest.zip
99
ARG ANDROID_BUILD_VERSION=29
1010
ARG ANDROID_TOOLS_VERSION=29.0.3
11-
ARG BUCK_VERSION=2020.05.14.01
11+
ARG BUCK_VERSION=2020.09.09.01
1212
ARG NDK_VERSION=20.1.5948944
1313
ARG NODE_VERSION=12.x
1414
ARG WATCHMAN_VERSION=4.9.0

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## Android Docker Image for react native
2-
[![CircleCI](https://circleci.com/gh/react-native-community/docker-android.svg?style=svg)](https://circleci.com/gh/react-native-community/docker-android)
2+
[![Publish](https://github.com/react-native-community/docker-android/workflows/Publish/badge.svg?event=release)](https://hub.docker.com/r/reactnativecommunity/react-native-android)
33
[![Docker Pulls](https://img.shields.io/docker/pulls/reactnativecommunity/react-native-android.svg?maxAge=3600)](https://hub.docker.com/r/reactnativecommunity/react-native-android)
44
[![Docker Layers](https://images.microbadger.com/badges/image/reactnativecommunity/react-native-android.svg)](https://hub.docker.com/r/reactnativecommunity/react-native-android)
55

0 commit comments

Comments
 (0)