Repository navigation
Trigger custom cloudbeaver image build #1034
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Trigger custom cloudbeaver image build | |
| on: | |
| schedule: | |
| - cron: "0 10 * * *" # Everyday at 10 AM UTC | |
| workflow_dispatch: | |
| env: | |
| BASE_IMAGE: dbeaver/cloudbeaver | |
| jobs: | |
| trigger-build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| with: | |
| ref: master | |
| token: ${{ secrets.SWF_TOKEN }} | |
| - name: Update image base | |
| run: | | |
| latestTag=$(curl -fsSL "https://hub.docker.com/v2/repositories/${{ env.BASE_IMAGE }}/tags/?page_size=1000" | jq -r '.results | .[] | .name' | grep -P '^26\.[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 | |
| 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}" | |
| # -0 is our revision of the image for this upstream version | |
| git tag ${latestTag}-0 -m "Release ${latestTag}-0" | |
| git push origin HEAD ${latestTag}-0 | |
| fi |