Skip to content

Fixing CI problem

Fixing CI problem #8

Workflow file for this run

name: Slogan Generator CI/CD
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [17] # Currently only 17, but easily extendable
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Make mvnw executable
run: chmod +x ./mvnw
- name: Build with Maven
run: ./mvnw clean package
- name: Run tests
run: ./mvnw test
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: quarkus-app
path: target/quarkus-app
docker:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: quarkus-app
path: target/quarkus-app
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./src/main/docker/Dockerfile.jvm
platforms: linux/amd64,linux/arm64
push: true
tags: greystone/slogan-generator:latest