From 0826617dc41b8223d8f81c73fa5d1ccf9cac088c Mon Sep 17 00:00:00 2001 From: "isidoro.nevares" Date: Thu, 26 Mar 2026 13:25:50 +0100 Subject: [PATCH] =?UTF-8?q?A=C3=B1adir=20.github/workflows/ci-cd.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci-cd.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/ci-cd.yml diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml new file mode 100644 index 0000000..c2d479a --- /dev/null +++ b/.github/workflows/ci-cd.yml @@ -0,0 +1,32 @@ +jobs: + build-and-push: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + # Si necesitas JDK/Maven para tests previos + - name: Set up JDK + uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 23 + + - name: Build Maven project + run: mvn clean package + + # Construir la imagen Docker usando el Dockerfile + - name: Build Docker image + run: docker build -t ghcr.io/${{ github.repository }}:latest . + + # Push a GHCR (GitHub Container Registry) + - name: Push Docker image + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Push image + run: docker push ghcr.io/${{ github.repository }}:latest \ No newline at end of file