Skip to content

Commit f4192b2

Browse files
authored
publish release to Docker Hub (#94)
1 parent 4cbbab3 commit f4192b2

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

Diff for: .github/workflows/publish.yml

+10-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ jobs:
77
push_to_registry:
88
name: Push Docker image to Docker Hub
99
runs-on: ubuntu-20.04
10+
env:
11+
DOCKER_IMAGE: reactnativecommunity/react-native-android
12+
if: ${{ startsWith(github.ref, 'refs/tags/v*') }}
1013
steps:
1114
- name: Check out the repo
1215
uses: actions/checkout@v2
@@ -20,10 +23,14 @@ jobs:
2023
username: ${{ secrets.DOCKER_USERNAME }}
2124
password: ${{ secrets.DOCKER_PASSWORD }}
2225

26+
- name: Prepare tags
27+
id: tags
28+
run: |
29+
VERSION=${GITHUB_REF#refs/tags/v}
30+
echo ::set-output name=tags::"${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:latest"
31+
2332
- name: Push to Docker Hub
2433
uses: docker/build-push-action@v2
2534
with:
2635
push: true
27-
tags: |
28-
reactnativecommunity/react-native-android:latest
29-
reactnativecommunity/react-native-android:${{ GITHUB_REF }}
36+
tags: ${{ steps.tags.outputs.tags }}

0 commit comments

Comments
 (0)