Skip to content

Commit 03fb794

Browse files
chore: CI for course
1 parent f54d42c commit 03fb794

46 files changed

Lines changed: 54 additions & 553 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: CI/CD on Pull Request
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
9+
jobs:
10+
build_test_app:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- uses: actions/setup-java@v5
18+
with:
19+
distribution: 'temurin'
20+
java-version: '21'
21+
cache: maven
22+
23+
- name: Build project
24+
run: |
25+
./mvnw clean package -DskipTests
26+
working-directory: itj-shopping-cart
27+
28+
- name: Run tests
29+
run: |
30+
./mvnw test
31+
working-directory: itj-shopping-cart
32+
33+
deploy_java_app:
34+
needs: build_test_app
35+
runs-on: ubuntu-latest
36+
37+
steps:
38+
- name: Checkout code
39+
uses: actions/checkout@v4
40+
41+
- name: Install Heroku CLI
42+
run: |
43+
curl https://cli-assets.heroku.com/install.sh | sh
44+
45+
- uses: akhileshns/heroku-deploy@v3.14.15 # This is the action
46+
with:
47+
heroku_api_key: ${{ secrets.HEROKU_API_KEY_SWEBP }}
48+
heroku_app_name: "itj-shopping-cart" #Must be unique in Heroku
49+
heroku_email: ${{ vars.HEROKU_USERNAME_SWEBP }}
50+
appdir: "itj-shopping-cart"
51+
usedocker: true
52+
53+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
spring.application.name=itj-shopping-cart
2+
server.port=${PORT:8080}

itj-shopping-cart/target/classes/application.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)