java #4
This file contains 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: 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 | |