Skip to content

[maven-release-plugin] prepare for next development iteration #504

[maven-release-plugin] prepare for next development iteration

[maven-release-plugin] prepare for next development iteration #504

name: REST Server - Continuous Integration
###
# Continuous integration GitHub Action
#
# -> Push your code to the `main` branch to have it automatically tested
#
###
on:
push:
branches:
- main
paths:
- 'rest-server/**'
- '.github/workflows/rest-server-continuous-integration.yml'
pull_request:
branches:
- main
paths:
- 'rest-server/**'
- '.github/workflows/rest-server-continuous-integration.yml'
jobs:
test:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: ${{ github.workspace }}/rest-server
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'oracle'
java-version: '23'
check-latest: false
cache: 'maven'
- name: Run tests
run: ./mvnw verify
build_native_docker_image:
name: Build and publish the native (Linux) Docker image
needs: [ test ]
runs-on: ubuntu-22.04
permissions:
actions: read
contents: read
deployments: read
packages: write
pull-requests: write
security-events: write
env:
DOCKER_IMAGE_NAME: 'ghcr.io/microsoft/nubesgen/nubesgen-native'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Login to GitHub Packages
run: docker login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} ghcr.io
- uses: graalvm/setup-graalvm@v1
with:
distribution: 'graalvm'
java-version: '23'
github-token: ${{ secrets.GITHUB_TOKEN }}
cache: 'maven'
- name: Build application with GraalVM
run: |
cd rest-server && ./mvnw -Pnative native:compile
- name: Build the native (GraalVM) Docker image
uses: docker/build-push-action@v6
with:
push: false
tags: ${{ env.DOCKER_IMAGE_NAME }}:main
file: ./rest-server/src/main/docker/Dockerfile.native
context: ./rest-server/
- name: Push to GitHub Packages
run: docker push ${{ env.DOCKER_IMAGE_NAME }}:main
if: ${{ github.repository == 'microsoft/nubesgen' && github.event_name != 'pull_request' }}