Skip to content

Commit

Permalink
Build Trigger workflow: Apply matrix on master and acceptance branches
Browse files Browse the repository at this point in the history
  • Loading branch information
hbenali committed Jan 22, 2024
1 parent 9b2c764 commit a36662f
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,33 @@ env:
jobs:
trigger-build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- ref: master
tagSuffix: ""
- ref: acceptance
tagSuffix: -acc
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Update image base
with:
ref: matrix.ref
- name: Update image base for ${{ matrix.ref }} branch
run: |
latestTag=$(curl -fsSL "https://hub.docker.com/v2/repositories/${{ env.BASE_IMAGE }}/tags/?page_size=1000" | jq -r '.results | .[] | .name' | grep -P '^[0-9]+\.[0-9]+\.[0-9]+$' | head -1)
if [ -z "${latestTag}" ]; then
echo "Error: Could not get latest tag of ${{ env.BASE_IMAGE }} image! Abort!"
exit 1
fi
sed -Ei "s|FROM dbeaver/cloudbeaver.*|FROM dbeaver/cloudbeaver:${latestTag}|g" Dockerfile && git add Dockerfile
git config --global user.email "exo-swf@exoplatform.com"
git config --global user.name "exo-swf"
git commit -m "Bump cloudbeaver version to ${latestTag}"
git tag ${latestTag} -m "Release ${latestTag}"
git push origin HEAD ${latestTag}
sed -Ei "s|FROM dbeaver/cloudbeaver.*|FROM dbeaver/cloudbeaver:${latestTag}{{ matrix.tagSuffix }}|g" Dockerfile && git add Dockerfile
if git diff-index --quiet HEAD; then
echo "Nothing to commit!"
else
git config --global user.email "exo-swf@exoplatform.com"
git config --global user.name "exo-swf"
git commit -m "Bump cloudbeaver version to ${latestTag}{{ matrix.tagSuffix }}"
git tag ${latestTag} -m "Release ${latestTag}{{ matrix.tagSuffix }}"
git push origin HEAD ${latestTag}{{ matrix.tagSuffix }}
fi

0 comments on commit a36662f

Please sign in to comment.