Skip to content

Commit

Permalink
Refactor GitHub Actions workflow to separate build and push steps for…
Browse files Browse the repository at this point in the history
… master and development branches
  • Loading branch information
L4B0MB4 committed Dec 8, 2024
1 parent a7c55e8 commit c8e0b6e
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/identification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,20 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/development' || startsWith(github.ref, 'refs/tags/')
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v6
with:
file: "./docker/command/Dockerfile"
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ vars.DOCKERHUB_USERNAME }}/pryvt_identification_command:${{ github.ref == 'refs/heads/master' && 'latest' || github.ref_name }}
tags: ${{ vars.DOCKERHUB_USERNAME }}/pryvt_identification_command:latest
- name: Build and push
if: github.ref == 'refs/heads/development' || startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v6
with:
file: "./docker/command/Dockerfile"
push: true
tags: ${{ vars.DOCKERHUB_USERNAME }}/pryvt_identification_command:${{ github.ref_name }}
- name: Build without push
if: github.ref != 'refs/heads/master' && github.ref != 'refs/heads/development' && !startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v6
Expand All @@ -66,13 +73,20 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/development' || startsWith(github.ref, 'refs/tags/')
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v6
with:
file: "./docker/query/Dockerfile"
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ vars.DOCKERHUB_USERNAME }}/pryvt_identification_query:${{ github.ref == 'refs/heads/master' && 'latest' || github.ref_name }}
tags: ${{ vars.DOCKERHUB_USERNAME }}/pryvt_identification_query:latest
- name: Build and push
if: github.ref == 'refs/heads/development' || startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v6
with:
file: "./docker/query/Dockerfile"
push: true
tags: ${{ vars.DOCKERHUB_USERNAME }}/pryvt_identification_query:${{ github.ref_name }}
- name: Build without push
if: github.ref != 'refs/heads/master' && github.ref != 'refs/heads/development' && !startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v6
Expand Down

0 comments on commit c8e0b6e

Please sign in to comment.