Skip to content

Commit

Permalink
build(ci): relocate Docker registry login actions
Browse files Browse the repository at this point in the history
- Move Docker registry login actions to after the build process
- Remove unnecessary indentation in workflow file
  • Loading branch information
vnobo committed Dec 14, 2024
1 parent 44c4872 commit 82d2fdf
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/gradle-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,6 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log into registry ${{ env.GITHUB_REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.GITHUB_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.PAGK_TOKEN }}

- name: Log into registry docker.io
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{env.DOCKER_REGISTRY}}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Set up JDK 21 for x64
uses: actions/setup-java@v4
with:
Expand All @@ -58,6 +42,22 @@ jobs:
chmod +x ./gradlew
./gradlew bootBuildImage
- name: Log into registry ${{ env.GITHUB_REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.GITHUB_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.PAGK_TOKEN }}

- name: Log into registry ${{ env.DOCKER_REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{env.DOCKER_REGISTRY}}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract platform metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
Expand Down

0 comments on commit 82d2fdf

Please sign in to comment.