Skip to content

Commit

Permalink
Reorder steps
Browse files Browse the repository at this point in the history
  • Loading branch information
nhalstead committed Dec 15, 2024
1 parent 666c605 commit 12a9827
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,6 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Registry
run: echo "${{ secrets.DOCKER_HUB_TOKEN }}" | docker login -u ${{ secrets.DOCKER_HUB_USER }} --password-stdin

- name: Login to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Github Short SHA
run: |
echo "GITHUB_SHA_SHORT=$(echo $GITHUB_SHA | cut -c 1-7)" >> $GITHUB_ENV
Expand All @@ -68,6 +59,18 @@ jobs:
echo "file_exists=false" >> $GITHUB_ENV
fi
- name: Set up Docker Buildx
if: env.file_exists == 'true'
uses: docker/setup-buildx-action@v3

- name: Login to Docker Registry
if: env.file_exists == 'true'
run: echo "${{ secrets.DOCKER_HUB_TOKEN }}" | docker login -u ${{ secrets.DOCKER_HUB_USER }} --password-stdin

- name: Login to GitHub Container Registry
if: env.file_exists == 'true'
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Build and push
uses: docker/build-push-action@v6
if: env.file_exists == 'true'
Expand Down

0 comments on commit 12a9827

Please sign in to comment.