Skip to content

Merge pull request #60 from RafeArnold/dependabot/gradle/ch.qos.logba… #71

Merge pull request #60 from RafeArnold/dependabot/gradle/ch.qos.logba…

Merge pull request #60 from RafeArnold/dependabot/gradle/ch.qos.logba… #71

name: Build and deploy
on:
push:
branches:
- main
jobs:
test:
uses: ./.github/workflows/test.yml
build:
runs-on: ubuntu-latest
needs:
- test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: corretto
java-version: 20
- uses: gradle/actions/setup-gradle@v3
- run: ./gradlew shadowJar
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v5
with:
push: false
tags: the-mind:latest
context: .
outputs: type=docker,dest=/tmp/the-mind.tar
- uses: actions/upload-artifact@v4
with:
name: app-image
path: /tmp/the-mind.tar
retention-days: 1
deploy:
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/download-artifact@v4
with:
name: app-image
path: distfiles
- uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
source: distfiles/*
target: ~/projects/the-mind/
strip_components: 1
- uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
script: |
cd ~/projects/the-mind
./deploy-tar.sh