Skip to content

Commit

Permalink
Add labels to Docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
alvr committed Mar 7, 2021
1 parent d414846 commit b94db1c
Showing 1 changed file with 38 additions and 29 deletions.
67 changes: 38 additions & 29 deletions .github/workflows/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ jobs:
uses: actions/checkout@v2

- name: Tags
shell: sh
run: |
set -eu
TAGS="jdk${{ matrix.jdk }}"
TAGS="$TAGS,latest-jdk${{ matrix.jdk }}"
if [ "${{ matrix.jdk }}" = "${{ env.DEFAULT_JDK_VERSION }}" ]; then
Expand Down Expand Up @@ -86,9 +89,17 @@ jobs:
file: ./docker/base.Dockerfile
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
build-args: |
JDK_VERSION=${{ matrix.jdk }}
- name: Update repo description
uses: peter-evans/dockerhub-description@v2
with:
username: ${{ env.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASS }}
repository: ${{ env.DH_IMAGE_BASE_NAME }}

build_images:
name: Build Alpine Android Image
needs: [build_base_images]
Expand All @@ -107,8 +118,11 @@ jobs:
id: tag_version
uses: battila7/get-version-action@v2

- name: Tags
- name: Set environment variables
shell: sh
run: |
set -eu
TAGS="android-${{ matrix.android-api }}-jdk${{ matrix.jdk }}"
TAGS="$TAGS,android-${{ matrix.android-api }}-jdk${{ matrix.jdk }}-${{ steps.tag_version.outputs.version }}"
if [ "${{ matrix.jdk }}" = "${{ env.DEFAULT_JDK_VERSION }}" ]; then
Expand All @@ -122,33 +136,20 @@ jobs:
fi
echo "TAGS=$TAGS" >> $GITHUB_ENV
- name: Build Tools
id: build_tools
run: |
if [ "${{ matrix.android-api }}" = "21" ]; then
VERSION="21.1.2"
elif [ "${{ matrix.android-api }}" = "22" ]; then
VERSION="22.0.1"
elif [ "${{ matrix.android-api }}" = "23" ]; then
VERSION="23.0.3"
elif [ "${{ matrix.android-api }}" = "24" ]; then
VERSION="24.0.3"
elif [ "${{ matrix.android-api }}" = "25" ]; then
VERSION="25.0.3"
elif [ "${{ matrix.android-api }}" = "26" ]; then
VERSION="26.0.3"
elif [ "${{ matrix.android-api }}" = "27" ]; then
VERSION="27.0.3"
elif [ "${{ matrix.android-api }}" = "28" ]; then
VERSION="28.0.3"
elif [ "${{ matrix.android-api }}" = "29" ]; then
VERSION="29.0.3"
elif [ "${{ matrix.android-api }}" = "30" ]; then
VERSION="30.0.3"
elif [ "${{ matrix.android-api }}" = "S" ]; then
VERSION="31.0.0-rc1"
fi
echo "::set-output name=version::$VERSION"
case ${{ matrix.android-api }} in
21) BUILD_TOOLS_VERSION="21.1.2" ;;
22) BUILD_TOOLS_VERSION="22.0.1" ;;
23) BUILD_TOOLS_VERSION="23.0.3" ;;
24) BUILD_TOOLS_VERSION="24.0.3" ;;
25) BUILD_TOOLS_VERSION="25.0.3" ;;
26) BUILD_TOOLS_VERSION="26.0.3" ;;
27) BUILD_TOOLS_VERSION="27.0.3" ;;
28) BUILD_TOOLS_VERSION="28.0.3" ;;
29) BUILD_TOOLS_VERSION="29.0.3" ;;
30) BUILD_TOOLS_VERSION="30.0.3" ;;
S) BUILD_TOOLS_VERSION="31.0.0-rc1" ;;
esac
echo "BUILD_TOOLS_VERSION=$BUILD_TOOLS_VERSION" >> $GITHUB_ENV
- name: Docker meta
id: docker_meta
Expand Down Expand Up @@ -191,7 +192,15 @@ jobs:
file: ./docker/android.Dockerfile
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
build-args: |
JDK_VERSION=${{ matrix.jdk }}
BUILD_TOOLS=${{ steps.build_tools.outputs.version }}
BUILD_TOOLS=${{ env.BUILD_TOOLS_VERSION }}
TARGET_SDK=${{ matrix.android-api }}
- name: Update repo description
uses: peter-evans/dockerhub-description@v2
with:
username: ${{ env.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASS }}
repository: ${{ env.DH_IMAGE_NAME }}

0 comments on commit b94db1c

Please sign in to comment.