Skip to content

Commit

Permalink
🔧 chore(.github/workflows/gradle-build.yml): Update Docker registry…
Browse files Browse the repository at this point in the history
… login and image push process.
  • Loading branch information
vnobo committed Dec 13, 2024
1 parent 3980940 commit b340d2e
Showing 1 changed file with 16 additions and 23 deletions.
39 changes: 16 additions & 23 deletions .github/workflows/gradle-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Log into registry ${{ env.REGISTRY }}
- name: Log into registry ${{ env.GITHUB_REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
Expand Down Expand Up @@ -53,28 +53,21 @@ jobs:
- name: Make gradlew executable
run: chmod +x ./gradlew

#Push to multiple registries with GitHub Actions
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
flavor: |
latest=true
images: |
${{ env.GITHUB_REGISTRY }}/plate-platform
${{ env.DOCKER_REGISTRY }}/plate-platform
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Execute Gradle platform bootBuildImage
run: ./gradlew bootBuildImage

- name: Build and push
uses: docker/build-push-action@v6
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Push image to GHCR
run: |
docker buildx imagetools create \
--tag ${{ env.GITHUB_REGISTRY }}/plate-platform:latest \
--tag ${{ env.GITHUB_REGISTRY }}/plate-platform:3.0.0 \
plate-platform:latest
docker buildx imagetools create \
--tag ${{ env.GITHUB_REGISTRY }}/plate-oauth2:latest \
--tag ${{ env.GITHUB_REGISTRY }}/plate-oauth2:3.0.0 \
plate-oauth2:latest

0 comments on commit b340d2e

Please sign in to comment.