Skip to content

Commit

Permalink
Commit tag from current branch, fix tags env var
Browse files Browse the repository at this point in the history
  • Loading branch information
bradbown committed Oct 17, 2024
1 parent 13e7a9a commit b89fc31
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/coordinator-build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Set develop tag if main branch
if: ${{ github.ref == 'refs/heads/main' }}
run: |
echo "TAGS=" >> $GITHUB_ENV
echo "TAGS=${{ inputs.image_name }}:${{ inputs.commit_tag }},${{ inputs.image_name }}:${{ inputs.develop_tag }}" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-java@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ jobs:

publish-images-after-run-tests-success-on-main:
needs: [ store-image-name-and-tags, testing, run-e2e-tests, run-e2e-tests-geth-tracing ]
if: ${{ always() && github.ref != 'refs/heads/main' && needs.testing.result == 'success' && needs.run-e2e-tests.outputs.tests_outcome == 'success' && needs.run-e2e-tests-geth-tracing.outputs.tests_outcome == 'success' }}
if: ${{ always() && github.ref == 'refs/heads/main' && needs.testing.result == 'success' && needs.run-e2e-tests.outputs.tests_outcome == 'success' && needs.run-e2e-tests-geth-tracing.outputs.tests_outcome == 'success' }}
uses: ./.github/workflows/build-and-publish.yml
with:
push_image: true
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/reuse-store-image-name-and-tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ jobs:
name: Compute version tags
env:
# REF_NAME: ${{ github.ref_name }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
EVENT_BEFORE: ${{ github.event.before }}
outputs:
commit_tag: ${{ steps.step1.outputs.COMMIT_TAG }}
Expand All @@ -31,7 +30,7 @@ jobs:
- name: Compute version tags
id: step1
run: |
echo COMMIT_TAG=$(git rev-parse --short "$GITHUB_SHA") >> $GITHUB_OUTPUT
echo COMMIT_TAG=$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT
echo LAST_COMMIT_TAG=$(git rev-parse --short "${{ env.EVENT_BEFORE }}") >> $GITHUB_OUTPUT
echo DEVELOP_TAG=develop >> $GITHUB_OUTPUT
- name: Show version tags
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/traces-api-facade-build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ jobs:
PUSH_IMAGE: ${{ inputs.push_image }}
TAGS: ${{ inputs.image_name }}:${{ inputs.commit_tag }}
steps:
- name: Set develop tag if main branch
if: ${{ github.ref == 'refs/heads/main' }}
run: |
echo "TAGS=${{ inputs.image_name }}:${{ inputs.commit_tag }},${{ inputs.image_name }}:${{ inputs.develop_tag }}" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -107,6 +111,6 @@ jobs:
file: ./traces-api-facade/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ env.PUSH_IMAGE }}
tags: ${{ inputs.image_name }}:${{ inputs.commit_tag }},${{ inputs.image_name }}:${{ inputs.develop_tag }}
tags: ${{ env.TAGS }}
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache
cache-to: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache,mode=max

0 comments on commit b89fc31

Please sign in to comment.