Skip to content

Commit

Permalink
ci: add docker build and push back to publish-release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
tommytroen committed Feb 25, 2020
1 parent fbb4a9d commit df4afcf
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:

env:
IMAGE_BASE_NAME: docker.pkg.github.com/${{ github.repository }}
IMAGE_NAME: ${IMAGE_BASE_NAME}/${IMAGE_NAME}

jobs:
publish-release:
Expand Down Expand Up @@ -48,13 +47,14 @@ jobs:

# The GITHUB_REF tag comes in the format 'refs/tags/xxx'.
# So if we split on '/' and take the 3rd value, we can get the release name.

# ./gradlew jibDockerBuild --image="${IMAGE_NAME}:${NEW_VERSION}"
# echo "$GITHUB_TOKEN" | docker login --username "$GITHUB_REPOSITORY" --password-stdin https://docker.pkg.github.com
# docker push "${IMAGE_NAME}:${NEW_VERSION}"
run: |
export GPG_TTY=$(tty) && echo ${GPG_KEY_BASE64} | base64 --decode | gpg --fast-import --batch
NEW_VERSION=$(echo "${GITHUB_REF}" | cut -d "/" -f3)
echo "New version: ${NEW_VERSION}"
REPO_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}')
IMAGE=${IMAGE_BASE_NAME}/${REPO_NAME}:${NEW_VERSION}
echo "Releasing new version ${NEW_VERSION} of ${REPO_NAME} and docker image $IMAGE"
./gradlew -Pversion=${NEW_VERSION} publish closeAndReleaseRepository -Dorg.gradle.internal.publish.checksums.insecure=true --info
./gradlew jibDockerBuild --image="${IMAGE}"
echo "$GITHUB_TOKEN" | docker login --username "$GITHUB_REPOSITORY" --password-stdin https://docker.pkg.github.com
docker push "${IMAGE}"

0 comments on commit df4afcf

Please sign in to comment.