Skip to content

Commit

Permalink
run build and push only on mainline, update secrets for bot account t…
Browse files Browse the repository at this point in the history
…o upload the images. (#28)

Signed-off-by: Roshan Khatri <[email protected]>
  • Loading branch information
roshkhatri authored Jul 30, 2024
1 parent 2ce6882 commit 5f95a51
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ jobs:
run: ${{ matrix.runs.images }}

build_and_push:
if: github.event_name == 'push'
if: |
(github.event_name == 'push' &&
github.ref == 'refs/heads/mainline')
needs:
- generate-jobs
- test
Expand All @@ -57,12 +59,12 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
# Tags are created by generate.sh in the format `valkey-container:<tag>`
# This step modifies the tags to `username/valkey:<tag>` to be provided to build-push github action.
# This step modifies the tags to `account/valkey:<tag>` to be provided to build-push github action.
- name: Modify Tags
id: modify_tags
run: |
original_tags="${{ toJson(matrix.meta.entries[0].tags) }}"
tags=$(echo $original_tags | sed 's/valkey-container/valkey\/valkey/g'| sed 's/\[ *//; s/ *\]//; s/ //g')
tags=$(echo $original_tags | sed 's/valkey-container/${{ secrets.DOCKERHUB_ACCOUNT }}\/valkey/g'| sed 's/\[ *//; s/ *\]//; s/ //g')
echo "modified_tags=$tags" >> $GITHUB_OUTPUT
- name: Set up QEMU
Expand Down

0 comments on commit 5f95a51

Please sign in to comment.