-
Notifications
You must be signed in to change notification settings - Fork 0
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
16 additions
and
37 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 |
---|---|---|
|
@@ -4,50 +4,29 @@ run-name: "Run ${{github.run_id}}, triggered by ${{github.actor}}" | |
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- main | ||
branches: [ "main" ] | ||
jobs: | ||
deploy-backend: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build backend | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
cache: 'gradle' | ||
cache-dependency-path: | | ||
backend/*.gradle* | ||
backend/**/gradle-wrapper.properties | ||
- name: Build backend | ||
working-directory: backend | ||
run: | | ||
./gradlew build --no-daemon | ||
cp build/libs/backend-1.0.0.jar ../backend.jar | ||
- name: Build frontend | ||
uses: actions/setup-node@v3 | ||
- uses: actions/checkout@v4 | ||
- name: Deploy backend to Heroku | ||
uses: akhileshns/[email protected] | ||
with: | ||
node-version: 20 | ||
cache: 'npm' | ||
cache-dependency-path: frontend/package-lock.json | ||
|
||
- name: Install dependencies | ||
working-directory: frontend | ||
run: | | ||
npm install | ||
npm run build | ||
heroku_api_key: ${{secrets.HEROKU_API_KEY}} | ||
heroku_app_name: ${{ secrets.HEROKU_BACKEND_NAME }} | ||
heroku_email: ${{ secrets.HEROKU_EMAIL }} | ||
branch: 'main' | ||
procfile: 'web: java $JAVA_OPTS -Dserver.port=$PORT -jar build/libs/backend-1.0.0.jar --spring.profiles.active=prod' | ||
|
||
- name: Deploy to Heroku | ||
deploy-frontend: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Deploy backend to Heroku | ||
uses: akhileshns/[email protected] | ||
with: | ||
heroku_api_key: ${{secrets.HEROKU_API_KEY}} | ||
heroku_app_name: ${{ secrets.HEROKU_APP_NAME }} | ||
heroku_app_name: ${{ secrets.HEROKU_FRONTEND_NAME }} | ||
heroku_email: ${{ secrets.HEROKU_EMAIL }} | ||
procfile: | | ||
web: java $JAVA_OPTS -Dserver.port=$PORT -jar backend.jar --spring.profiles.active=prod | ||
build: cd frontend && npm start | ||
appdir: 'frontend' |