Skip to content

Merge pull request #6 from ketor/wip-update-20250120 #13

Merge pull request #6 from ketor/wip-update-20250120

Merge pull request #6 from ketor/wip-update-20250120 #13

Workflow file for this run

name: CI Build
on:
push:
branches: [ "main" ]
tags:
- '*'
pull_request:
branches: [ "main" ]
env:
BUILD_TYPE: Release
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set Safe Dir
run: git config --global --add safe.directory $PWD
- name: Record event type
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "EVENT_TYPE=PR" >> $GITHUB_ENV
elif [ "${{ github.event_name }}" == "push" ]; then
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "EVENT_TYPE=TAG" >> $GITHUB_ENV
tagInfo=$(echo "${{ github.ref }}" | sed 's/refs\/tags\///')
if [ -n "$tagInfo" ]; then
echo "TAG_NAME=$tagInfo" >> $GITHUB_ENV
fi
else
echo "EVENT_TYPE=PUSH" >> $GITHUB_ENV
fi
fi
- name: Sync submodules
run: |
git submodule sync --recursive
git submodule update --init --recursive
- name: Clean .git directory
run: |
find . -name ".git" -type d -exec rm -rf {} +
- name: Set up Docker Buildx
if: ${{ github.event_name == 'push'}}
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
if: ${{ github.event_name == 'push'}}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker meta
if: ${{ github.event_name == 'push'}}
id: meta
uses: docker/metadata-action@v5
with:
images: dingodatabase/dingo-eureka
tags: |
type=raw,enable=${{ env.EVENT_TYPE == 'TAG' }},value=${{ env.TAG_NAME }}
type=raw,value=latest,enable={{is_default_branch}}
type=sha,prefix=,format=long
- name: Build and push
if: ${{ github.event_name == 'push'}}
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/eureka/rocky9/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}