Añadir .github/workflows/ci-cd.yml
This commit is contained in:
parent
2457f987f6
commit
0826617dc4
32
.github/workflows/ci-cd.yml
vendored
Normal file
32
.github/workflows/ci-cd.yml
vendored
Normal file
@ -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
|
||||
Loading…
Reference in New Issue
Block a user