-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Build and Publish | ||
|
||
on: | ||
push: | ||
branches: [ develop ] | ||
|
||
jobs: | ||
gradle-build: | ||
name: Gradle build | ||
runs-on: ubuntu-latest | ||
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: Move to backend directory | ||
run: cd backend | ||
|
||
- name: Grant execute permission to gradlew | ||
run: chmod +x ./gradlew | ||
|
||
- name: Build with Gradle | ||
run: ./gradlew bootJar | ||
|
||
- name: Temporarily save build artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: gradle-build | ||
path: build | ||
retention-days: 1 | ||
|
||
publish-gcr: | ||
runs-on: ubuntu-latest | ||
needs: gradle-build | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Get gradle built artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: gradle-build | ||
path: build | ||
|
||
- 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 |