Skip to content

chore: Logging

chore: Logging #14

Workflow file for this run

name: Build backend
on:
push:
branches: [ "main" ]
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
# Checkout the repo files
- name: Checkout repository
uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
# Generate files to compile the tailwind into a css file
- name: Prepare tailwind
run: ./gradlew backend:tailwindPrepare
# Node territory
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18
- name: Tailwind install
run: npm install -D tailwindcss
working-directory: tailwind
# Generate the css file into the backend's resources folder. :))))
- name: Create tailwind .css file
run: npx tailwindcss -o ../backend/src/main/resources/static/css/tailwind.css --minify
working-directory: tailwind
# Back into Gradle territory
- name: Kotlin JS
run: ./gradlew jsBrowserDistribution
- name: Build backend
run: ./gradlew backend:assemble
- name: Grab gradle version
run: |
echo "VERSION_NAME=$(${{github.workspace}}/gradlew -q ciVersion)" >> $GITHUB_OUTPUT
id: version
- name: Generate short sha
uses: benjlevesque/short-sha@v2.2
id: tags
with:
length: 6
# Docker time!
- name: Log in to docker hub
uses: docker/login-action@v2.1.0
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v4.4.0
with:
images: lichthund/website
tags: |
type=semver,pattern={{version}},value=${{steps.version.outputs.VERSION_NAME}}-${{ steps.tags.outputs.sha }}
flavor: |
latest=true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push Docker image
uses: docker/build-push-action@v4.0.0
with:
context: .
file: backend/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}