Skip to content

java

java #4

Workflow file for this run

name: java
on:
workflow_dispatch:
jobs:
run:
runs-on: ubuntu-latest
strategy:
matrix:
maven: [ '3.9.6' ]
java: ['17']
environment: dev
defaults:
run:
shell: bash
steps:
- name: Descargar Repositorio
uses: actions/checkout@v4
- name: Setup Maven Action
uses: s4u/[email protected]
with:
java-version: ${{ matrix.java }}
maven-version: ${{ matrix.maven }}
- name: Validate java and maven version
run: |
mvn --version
java --version
- name: Build with Maven
run: mvn clean package
working-directory: ./demo
- uses: azure/docker-login@v1
with:
login-server: ${{ vars.REGISTRY_SERVER }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push Docker image
run: |
docker build . -t ${{ vars.REGISTRY_SERVER }}/java:latest
docker push ${{ vars.REGISTRY_SERVER }}/adventure:latest