Arreglo orden gradlew #2
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: Build and Publish Federated Catalog Image (Main) | |
| on: | |
| push: | |
| branches: | |
| - "feature/deployment" | |
| paths: | |
| - 'federated-catalog/**' | |
| - '.github/workflows/federated-catalog.yml' | |
| concurrency: | |
| group: fc-main | |
| cancel-in-progress: true | |
| jobs: | |
| # ------------------------------ | |
| # 1. BUILD & PUSH FC DOCKER IMAGE | |
| # ------------------------------ | |
| build-and-push-fc: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| id-token: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| # -------- LOGIN GHCR -------- | |
| - name: Login to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| # -------- GRADLE BUILD -------- | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| - name: Make Gradle executable | |
| run: chmod +x ./gradlew | |
| - name: Build federated catalog JAR | |
| run: | | |
| ./gradlew clean build | |
| - name: Change directory to Federated Catalog directory | |
| run: | | |
| cd federated-catalog | |
| # --------------------------------- | |
| - name: Set dynamic tags for migrations and API | |
| id: vars | |
| run: | | |
| IMAGE_BASE_FC="ghcr.io/wake-ua/federated-catalog" | |
| DATE=$(date +%Y%m%d) | |
| SHA_SHORT=$(echo "${GITHUB_SHA}" | cut -c1-7) | |
| # Tags for federated catalog image | |
| echo "FC_LATEST=${IMAGE_BASE_FC}:latest" >> $GITHUB_OUTPUT | |
| echo "FC_SHA=${IMAGE_BASE_FC}:${SHA_SHORT}" >> $GITHUB_OUTPUT | |
| echo "FC_DATE=${IMAGE_BASE_FC}:${DATE}" >> $GITHUB_OUTPUT | |
| # -------- DOCKER BUILD & PUSH -------- | |
| - name: Build Docker image for migrations | |
| run: | | |
| docker build -f migrations/Dockerfile \ | |
| -t ${{ steps.vars.outputs.FC_LATEST }} \ | |
| -t ${{ steps.vars.outputs.FC_SHA }} \ | |
| -t ${{ steps.vars.outputs.FC_DATE }} \ | |
| . | |
| - name: Push migrations images | |
| run: | | |
| docker push ${{ steps.vars.outputs.FC_LATEST }} | |
| docker push ${{ steps.vars.outputs.FC_SHA }} | |
| docker push ${{ steps.vars.outputs.FC_DATE }} | |
| # --------------------------------- | |