Skip to content

Commit

Permalink
enable conditionals
Browse files Browse the repository at this point in the history
  • Loading branch information
alcohol committed Jun 20, 2024
1 parent 2c5c50a commit 096f0c2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,22 +125,22 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
#if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Login to Amazon Public ECR
#if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: public.ecr.aws
username: ${{ secrets.AWS_ECR_ACCESS_KEY }}
password: ${{ secrets.AWS_ECR_SECRET_KEY }}

- name: Login to Github Container Registry
#if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
Expand All @@ -155,7 +155,7 @@ jobs:
target: binary-with-runtime
annotations: ${{ needs.prepare.outputs.full-annotations }}
platforms: ${{ matrix.platform }}
outputs: type=image,"name=${{ env.DOCKERHUB_SLUG }},${{ env.ECR_SLUG }},${{ env.GHCR_SLUG }}",push-by-digest=true,name-canonical=true,push=true #if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
outputs: type=image,"name=${{ env.DOCKERHUB_SLUG }},${{ env.ECR_SLUG }},${{ env.GHCR_SLUG }}",push-by-digest=true,name-canonical=true,push=${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }}

- name: Build binary-only image
id: build-bin
Expand All @@ -165,7 +165,7 @@ jobs:
target: standalone-binary
annotations: ${{ needs.prepare.outputs.bin-annotations }}
platforms: ${{ matrix.platform }}
outputs: type=image,"name=${{ env.DOCKERHUB_SLUG }},${{ env.ECR_SLUG }},${{ env.GHCR_SLUG }}",push-by-digest=true,name-canonical=true,push=true #if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
outputs: type=image,"name=${{ env.DOCKERHUB_SLUG }},${{ env.ECR_SLUG }},${{ env.GHCR_SLUG }}",push-by-digest=true,name-canonical=true,push=${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }}

- name: Export digests
run: |
Expand All @@ -187,7 +187,7 @@ jobs:

merge:

#if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'

runs-on: ubuntu-latest

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/legacy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,22 +125,22 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
#if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Login to Amazon Public ECR
#if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: public.ecr.aws
username: ${{ secrets.AWS_ECR_ACCESS_KEY }}
password: ${{ secrets.AWS_ECR_SECRET_KEY }}

- name: Login to Github Container Registry
#if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
Expand All @@ -155,7 +155,7 @@ jobs:
target: binary-with-runtime
annotations: ${{ needs.prepare.outputs.full-annotations }}
platforms: ${{ matrix.platform }}
outputs: type=image,"name=${{ env.DOCKERHUB_SLUG }},${{ env.ECR_SLUG }},${{ env.GHCR_SLUG }}",push-by-digest=true,name-canonical=true,push=true #if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
outputs: type=image,"name=${{ env.DOCKERHUB_SLUG }},${{ env.ECR_SLUG }},${{ env.GHCR_SLUG }}",push-by-digest=true,name-canonical=true,push=${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }}

- name: Build binary-only image
id: build-bin
Expand All @@ -165,7 +165,7 @@ jobs:
target: standalone-binary
annotations: ${{ needs.prepare.outputs.bin-annotations }}
platforms: ${{ matrix.platform }}
outputs: type=image,"name=${{ env.DOCKERHUB_SLUG }},${{ env.ECR_SLUG }},${{ env.GHCR_SLUG }}",push-by-digest=true,name-canonical=true,push=true #if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
outputs: type=image,"name=${{ env.DOCKERHUB_SLUG }},${{ env.ECR_SLUG }},${{ env.GHCR_SLUG }}",push-by-digest=true,name-canonical=true,push=${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }}

- name: Export digests
run: |
Expand All @@ -187,7 +187,7 @@ jobs:

merge:

#if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'

runs-on: ubuntu-latest

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/lts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,22 +125,22 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
#if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Login to Amazon Public ECR
#if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: public.ecr.aws
username: ${{ secrets.AWS_ECR_ACCESS_KEY }}
password: ${{ secrets.AWS_ECR_SECRET_KEY }}

- name: Login to Github Container Registry
#if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
Expand All @@ -155,7 +155,7 @@ jobs:
target: binary-with-runtime
annotations: ${{ needs.prepare.outputs.full-annotations }}
platforms: ${{ matrix.platform }}
outputs: type=image,"name=${{ env.DOCKERHUB_SLUG }},${{ env.ECR_SLUG }},${{ env.GHCR_SLUG }}",push-by-digest=true,name-canonical=true,push=true #if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
outputs: type=image,"name=${{ env.DOCKERHUB_SLUG }},${{ env.ECR_SLUG }},${{ env.GHCR_SLUG }}",push-by-digest=true,name-canonical=true,push=${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }}

- name: Build binary-only image
id: build-bin
Expand All @@ -165,7 +165,7 @@ jobs:
target: standalone-binary
annotations: ${{ needs.prepare.outputs.bin-annotations }}
platforms: ${{ matrix.platform }}
outputs: type=image,"name=${{ env.DOCKERHUB_SLUG }},${{ env.ECR_SLUG }},${{ env.GHCR_SLUG }}",push-by-digest=true,name-canonical=true,push=true #if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
outputs: type=image,"name=${{ env.DOCKERHUB_SLUG }},${{ env.ECR_SLUG }},${{ env.GHCR_SLUG }}",push-by-digest=true,name-canonical=true,push=${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }}

- name: Export digests
run: |
Expand All @@ -187,7 +187,7 @@ jobs:

merge:

#if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'

runs-on: ubuntu-latest

Expand Down

0 comments on commit 096f0c2

Please sign in to comment.