forked from HamaHama-Dev/pupmory
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (49 loc) · 1.39 KB
/
build-n-publish.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 Publish
on:
push:
branches: [ main ]
jobs:
gradle-build:
name: Gradle build
runs-on: ubuntu-latest
env:
working-directory: ./backend
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Grant execute permission to gradlew
run: chmod +x ./gradlew
working-directory: ${{ env.working-directory }}
- name: Build with Gradle
run: ./gradlew bootJar
working-directory: ${{ env.working-directory }}
- name: Temporarily save build artifact
uses: actions/upload-artifact@v2
with:
name: gradle-build
path: backend/build/libs/*.jar
retention-days: 1
publish-gcr:
name: Publish to GCR
runs-on: ubuntu-latest
needs: gradle-build
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
- name: Get gradle built artifact
uses: actions/download-artifact@v2
with:
name: gradle-build
path: backend/build/libs
- name: Docker Build and Publish latest image
uses: VaultVulp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
image-name: pupmory-backend # tag will be automatically set to latest