Updating CI script. #2
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: Test JIB | |
on: | |
push: | |
branches: [ dev ] | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- name: Code Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'adopt' | |
java-version: '17' | |
- name: Get Gradle Version | |
run: | | |
VERSION=$(grep 'version' build.gradle | cut -f 2 -d "'") | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
echo "REPO=$GITHUB_REPOSITORY" >> $GITHUB_ENV | |
echo "OWNER=$GITHUB_REPOSITORY_OWNER" >> $GITHUB_ENV | |
# - name: Check if version is used | |
# run: | | |
# URL=$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/releases/latest | |
# LATEST=$(curl --silent "$URL" | jq -r .name) | |
# if [ "$LATEST" == "$VERSION" ]; then | |
# echo "Version already used: $VERSION" | |
# exit 1 | |
# fi | |
- name: Generating self-signed certificate | |
run: | | |
openssl req \ | |
-newkey rsa:2048 \ | |
-new \ | |
-nodes \ | |
-x509 \ | |
-days 3650 \ | |
-keyout key.pem \ | |
-out cert.pem \ | |
-subj "/C=US/ST=SC/L=Hometown/O=IT/emailAddress=root@localhost/CN=localhost" | |
- name: Build | |
run: | | |
./gradlew build --no-daemon \ | |
-DskipTests \ | |
-Dquarkus.package.type=native \ | |
-Dquarkus.native.container-build=true \ | |
-Dquarkus.container-image.build=true \ | |
-Dquarkus.container-image.push=true \ | |
-Dquarkus.container-image.username=${{ env.OWNER }} \ | |
-Dquarkus.container-image.password=${{ secrets.DOCKER_TOKEN }} \ | |
-Dquarkus.container-image.group=${{ env.OWNER }} \ | |
-Dquarkus.container-image.name=${{ env.REPO }} \ | |
-Dquarkus.container-image.tag=t${{ env.VERSION }} \ | |
-Dquarkus.container-image.additional-tags=test \ | |
-Dquarkus.jib.platforms=linux/amd64,linux/arm64 | |
# - name: Login to DockerHub | |
# uses: docker/login-action@v3 | |
# with: | |
# username: ${{ env.OWNER }} | |
# password: ${{ secrets.DOCKER_TOKEN }} | |
# - name: Docker Build & Push | |
# uses: docker/build-push-action@v5 | |
# with: | |
# push: true | |
# context: . | |
# file: src/main/docker/Dockerfile.native-micro | |
# tags: | | |
# ${{ env.REPO }}:${{ env.VERSION }} | |
# ${{ env.REPO }}:latest | |
# - name: Creating GitHub Tag | |
# uses: mathieudutour/[email protected] | |
# with: | |
# custom_tag: ${{ env.VERSION }} | |
# github_token: ${{ secrets.GITHUB_TOKEN }} | |
# - name: Create GitHub Release | |
# uses: ncipollo/release-action@v1 | |
# with: | |
# tag: ${{ env.VERSION }} | |
# token: ${{ secrets.GITHUB_TOKEN }} | |
# - name: Overwrite Coverage Theme | |
# run: | | |
# /bin/cp -rf helpers/coverage/* build/coverage/. | |
# - name: Publishing to GitHub Pages | |
# uses: peaceiris/actions-gh-pages@v3 | |
# with: | |
# publish_dir: ./build/coverage | |
# github_token: ${{ secrets.GITHUB_TOKEN }} |