Eliminando pasos innecesarios #5
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: Set dynamic tags for Federated Catalog | |
| 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 Federated Catalog | |
| run: | | |
| docker build \ | |
| -t ${{ steps.vars.outputs.FC_LATEST }} \ | |
| -t ${{ steps.vars.outputs.FC_SHA }} \ | |
| -t ${{ steps.vars.outputs.FC_DATE }} \ | |
| ./federated-catalog | |
| - name: Push Federated Catalog images | |
| run: | | |
| docker push ${{ steps.vars.outputs.FC_LATEST }} | |
| docker push ${{ steps.vars.outputs.FC_SHA }} | |
| docker push ${{ steps.vars.outputs.FC_DATE }} | |
| # --------------------------------- | |