-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (57 loc) · 1.45 KB
/
build-and-deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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