Fix flyway & jooq database url #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: Github CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
packages: write | |
jobs: | |
build: | |
runs-on: home-laboratory-runner | |
services: | |
postgres: | |
image: postgres:15.2 | |
env: | |
POSTGRES_DB: finwavebot | |
POSTGRES_USER: finwavebot | |
POSTGRES_PASSWORD: change_me | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Build with Gradle | |
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1 | |
with: | |
arguments: build | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: FinWave Telegram Bot | |
path: build/libs/*.jar | |
build-docker: | |
needs: build | |
runs-on: self-hosted | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: FinWave Telegram Bot | |
- name: Extract version | |
id: get_version | |
run: echo "::set-output name=VERSION::$(grep "version =" build.gradle | awk -F\' '{print $2}')" | |
- name: 'Login to GitHub Container Registry' | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{github.actor}} | |
password: ${{secrets.GITHUB_TOKEN}} | |
- name: Push Docker image | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
push: true | |
tags: | | |
ghcr.io/finwave-telegram-bot/bot:latest | |
ghcr.io/finwave-telegram-bot/bot:${{ steps.get_version.outputs.VERSION }} | |
labels: | | |
org.opencontainers.image.source=${{ github.event.repository.html_url }} |