Skip to content

Added native

Added native #152

Workflow file for this run

name: Build and Release
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
outputs:
image_name: ${{ env.IMAGE_NAME }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup GraalVM
uses: graalvm/setup-graalvm@v1
with:
java-version: '22'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Run tests
run: ./gradlew test
- name: Submit tests to CodeCov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Generate new tag
id: tag
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag_prefix: ''
- name: Setup Docker metadata
run: |
echo "IMAGE_NAME=ghcr.io/${{github.repository}}:${{ steps.tag.outputs.new_tag }}" >> $GITHUB_ENV
echo "DOCKER_USER=${{ github.actor }}" >> $GITHUB_ENV
echo "DOCKER_PASS=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
- name: Build native image
run: ./gradlew bootBuildImage
release:
needs: build
runs-on: on-prem
environment: 'Prod'
env:
DEPLOYMENT: ${{ github.event.repository.name }}
steps:
- name: Perform rolling update
run: |
kubectl set image deployment/${DEPLOYMENT} ${DEPLOYMENT}=${{ needs.build.outputs.image_name }} -n default
kubectl rollout status deployment/${DEPLOYMENT} -n default
- name: Delete old packages
uses: smartsquaregmbh/[email protected]
with:
keep: 2
type: container
names: ${{ env.DEPLOYMENT }}
token: ${{ secrets.GITHUB_TOKEN }}
organization: ${{ github.event.organization.login }}