From 6aea5aff221b42cfc7657798dcdbb59dcbc96344 Mon Sep 17 00:00:00 2001 From: "ralph.collett" Date: Thu, 7 Apr 2022 12:24:27 +0100 Subject: [PATCH 1/4] Add Github action demo. --- .github/workflows/github-actions-demo.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/github-actions-demo.yml diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml new file mode 100644 index 0000000..75be101 --- /dev/null +++ b/.github/workflows/github-actions-demo.yml @@ -0,0 +1,17 @@ +name: GitHub Actions Demo +on: [push] +jobs: + Explore-GitHub-Actions: + runs-on: ubuntu-latest + steps: + - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." + - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" + - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." + - name: Check out repository code + uses: actions/checkout@v3 + - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." + - run: echo "🖥️ The workflow is now ready to test your code on the runner." + - name: List files in the repository + run: | + ls ${{ github.workspace }} + - run: echo "🍏 This job's status is ${{ job.status }}." From a3fa1772d1f16132bb49b27243df8d4237184eb9 Mon Sep 17 00:00:00 2001 From: "ralph.collett" Date: Thu, 7 Apr 2022 12:27:35 +0100 Subject: [PATCH 2/4] Add Github action verify. --- .github/workflows/verify.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/verify.yml diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml new file mode 100644 index 0000000..97d9d46 --- /dev/null +++ b/.github/workflows/verify.yml @@ -0,0 +1,17 @@ +name: Java CI + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'adopt' + - name: Build with Maven + run: mvn verify \ No newline at end of file From 64c335e8bbcc501b1895cd6395d15ad366962713 Mon Sep 17 00:00:00 2001 From: "ralph.collett" Date: Thu, 7 Apr 2022 12:43:32 +0100 Subject: [PATCH 3/4] Deploy to Heroku. --- .github/workflows/verify.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 97d9d46..1c3e1f6 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -14,4 +14,10 @@ jobs: java-version: '11' distribution: 'adopt' - name: Build with Maven - run: mvn verify \ No newline at end of file + run: mvn verify + - uses: actions/checkout@v2 + - uses: akhileshns/heroku-deploy@v3.12.12 # This is the action + with: + heroku_api_key: ${{secrets.HEROKU_API_KEY}} + heroku_app_name: "ralph-app" #Must be unique in Heroku + heroku_email: "ralph.collett@gmail.com" \ No newline at end of file From 81a48dc908eaaa03aba7f34cfb55a6f1ff05bc1a Mon Sep 17 00:00:00 2001 From: "ralph.collett" Date: Thu, 7 Apr 2022 12:45:50 +0100 Subject: [PATCH 4/4] Change to index page to test deploy. --- .github/workflows/github-actions-demo.yml | 17 ----------------- .github/workflows/verify.yml | 4 ++-- .../java/com/develogical/web/IndexPage.java | 2 +- 3 files changed, 3 insertions(+), 20 deletions(-) delete mode 100644 .github/workflows/github-actions-demo.yml diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml deleted file mode 100644 index 75be101..0000000 --- a/.github/workflows/github-actions-demo.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: GitHub Actions Demo -on: [push] -jobs: - Explore-GitHub-Actions: - runs-on: ubuntu-latest - steps: - - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." - - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" - - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." - - name: Check out repository code - uses: actions/checkout@v3 - - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." - - run: echo "🖥️ The workflow is now ready to test your code on the runner." - - name: List files in the repository - run: | - ls ${{ github.workspace }} - - run: echo "🍏 This job's status is ${{ job.status }}." diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 1c3e1f6..94f9d9b 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -16,8 +16,8 @@ jobs: - name: Build with Maven run: mvn verify - uses: actions/checkout@v2 - - uses: akhileshns/heroku-deploy@v3.12.12 # This is the action + - uses: akhileshns/heroku-deploy@v3.12.12 with: heroku_api_key: ${{secrets.HEROKU_API_KEY}} - heroku_app_name: "ralph-app" #Must be unique in Heroku + heroku_app_name: "ralph-app" heroku_email: "ralph.collett@gmail.com" \ No newline at end of file diff --git a/src/main/java/com/develogical/web/IndexPage.java b/src/main/java/com/develogical/web/IndexPage.java index 7de3044..415d703 100644 --- a/src/main/java/com/develogical/web/IndexPage.java +++ b/src/main/java/com/develogical/web/IndexPage.java @@ -7,7 +7,7 @@ public class IndexPage extends HtmlPage { @Override protected void writeContentTo(PrintWriter writer) { writer.println( - "

Welcome!

" + + "

Welcome Ralph!

" + "

Enter your query in the box below: " + "

" + "" +