Skip to content

Build @horn/brando

Build @horn/brando #2

Workflow file for this run

name: Build @horn/brando
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
name: Build $ Push
runs-on: ubuntu-22.04
# Service containers to run with `container-job`
services:
# Label used to access the service container
redis:
# Docker Hub image
image: redis
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Check out code
uses: actions/checkout@v4
with:
token: ${{ secrets.HORN_ACTIONS_WORKER_TOKEN }}
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
cache: 'sbt'
- name: Compile & Test
run: sbt test
env:
GITHUB_TOKEN: ${{ secrets.DEPLOY_GITHUB_TOKEN }}
- name: Fetch version from build.sbt
id: current_version
run: echo "version=$(grep "version.*:=" version.sbt | sed 's/.*"\(.*\)"/\1/')" >> $GITHUB_OUTPUT
- name: Publish API to github package registry
run: sbt +publish
env:
GITHUB_TOKEN: ${{ secrets.DEPLOY_GITHUB_TOKEN }}
- uses: rickstaa/action-create-tag@v1
with:
tag: ${{ steps.current_version.outputs.version }}
tag_exists_error: false