Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions .github/workflows/basic-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,30 @@ name: Continuous integration example

on:
push:
paths:
- src/**
- pom.xml

jobs:

test:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
- name: Set up JDK ${{matrix.java}}
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- run: mvn test
- name: Run tests
run: mvn test
- name: Generate tag
run: echo "tag=$(mvn -q help:evaluate -Dexpression=project.version -DforceStdout)" >> $GITHUB_OUTPUT
id: project

- name: Generate Docker image
run: mvn spring-boot:build-image -DskipTests -Dspring-boot.build-image.imageName=${{ secrets.DOCKERHUB_USERNAME }}/calculadora:${{ steps.project.outputs.tag }}
- name: Login to DockerHub
run: docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" -p "${{ secrets.DOCKERHUB_TOKEN }}"
- name: Push image to DockerHub
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/calculadora:0.0.1-SNAPSHOT
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Ejemplo de Integración Continua con GitHub Actions

Este proyecto ofrece una Calculadora hecha en Java
Cambio 2
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>es.codeurjc.test</groupId>
<artifactId>calculadora</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.1</version>
<packaging>jar</packaging>

<properties>
Expand Down