Skip to content

Commit

Permalink
Fix deploy
Browse files Browse the repository at this point in the history
- Default REGISTRY to docker.io for releases
- Create separate job for update docker README
  • Loading branch information
hyness committed Mar 31, 2024
1 parent 08ce92d commit e9588f3
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ on:
env:
DEFAULT_JAVA_VERSION: 17
DEFAULT_JAVA_TYPE: jre
REGISTRY: docker.io

jobs:
create-variables:
Expand All @@ -36,6 +37,7 @@ jobs:
with:
ref: ${{ github.event.workflow_run.head_branch }}
- name: Update the registry
if: ${{ github.event.inputs.registry != '' }}
run: echo "REGISTRY=${{ github.event.inputs.registry }}" >> $GITHUB_ENV
- name: Set up JDK 17
uses: actions/setup-java@v4
Expand Down Expand Up @@ -115,9 +117,21 @@ jobs:
-PdockerTags=$DOCKER_TAGS
--imageName=$IMAGE:$CLOUD_CONFIG_BUILD_VERSION-$SHORT_SHA-$JAVA
--publishImage
- name: Update Docker Hub README
if: env.REGISTRY == 'docker.io'
uses: meeDamian/sync-readme@v1.0.6
update-docker-hub-description:
name: Update Docker Hub README
needs:
- create-variables
- build-and-deploy-to-registry
if: needs.create-variables.outputs.registry == 'docker.io'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_branch }}
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v4
with:
pass: ${{ secrets.DOCKER_PASS }}
description: true
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

0 comments on commit e9588f3

Please sign in to comment.