Skip to content

Commit

Permalink
add conditionals to be used
Browse files Browse the repository at this point in the history
  • Loading branch information
alcohol committed Jun 15, 2024
1 parent 4b127ec commit 534d48c
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/v2-lts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ jobs:
runs-on: ubuntu-latest

outputs:
full-json: ${{ steps.meta-full.outputs.json }}
full-annotations: ${{ steps.meta-full.outputs.annotations }}
bin-json: ${{ steps.meta-bin.outputs.json }}
full-labels: ${{ steps.meta-full.outputs.labels }}
full-json: ${{ steps.meta-full.outputs.json }}
bin-annotations: ${{ steps.meta-bin.outputs.annotations }}
bin-labels: ${{ steps.meta-bin.outputs.labels }}
bin-json: ${{ steps.meta-bin.outputs.json }}

steps:

Expand Down Expand Up @@ -123,19 +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'
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'
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'
uses: docker/login-action@v3
with:
registry: ghcr.io
Expand All @@ -150,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
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'

- name: Build binary-only image
id: build-bin
Expand All @@ -160,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
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'

- name: Export digests
run: |
Expand All @@ -179,7 +184,6 @@ jobs:
/tmp/digests/bin/*
if-no-files-found: error
retention-days: 1
overwrite: true

merge:

Expand Down

0 comments on commit 534d48c

Please sign in to comment.