diff --git a/.github/workflows/autocommit.yaml b/.github/workflows/autocommit.yaml new file mode 100644 index 0000000..474e65c --- /dev/null +++ b/.github/workflows/autocommit.yaml @@ -0,0 +1,28 @@ +name: Keep Repository Active + +on: + schedule: + - cron: '0 0 */28 * *' + +jobs: + create-empty-commit: + runs-on: ubuntu-latest + + permissions: + contents: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: main + + - name: Configure Git + run: | + git config user.name 'Automatic action' + git config user.email 'noreply@koyeb.com' + + - name: Create an empty commit and push + run: | + git commit --allow-empty -m "Automated empty commit to keep repo active" -m "This commit is generated automatically every few weeks to prevent GitHub Actions from being disabled due to inactivity." + git push origin main diff --git a/.github/workflows/cleanup.yaml b/.github/workflows/cleanup.yaml new file mode 100644 index 0000000..a082f2b --- /dev/null +++ b/.github/workflows/cleanup.yaml @@ -0,0 +1,20 @@ +name: Cleanup Koyeb application + +on: + delete: + branches: + - '*' + +jobs: + cleanup: + runs-on: ubuntu-latest + steps: + - name: Install and configure the Koyeb CLI + uses: koyeb-community/install-koyeb-cli@v2 + with: + api_token: "${{ secrets.KOYEB_EXAMPLES_APPS_TOKEN }}" + + - name: Cleanup Koyeb application + uses: koyeb/action-git-deploy/cleanup@v1 + with: + app-name: spring-boot-${{ github.event.ref }} diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..350b85a --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,28 @@ +name: Build and deploy the application to Koyeb + +on: + schedule: + - cron: '55 8 * * *' + push: + branches: + - '*' + +jobs: + deploy: + concurrency: + group: "${{ github.ref_name }}" + cancel-in-progress: true + runs-on: ubuntu-latest + steps: + - name: Install and configure the Koyeb CLI + uses: koyeb-community/install-koyeb-cli@v2 + with: + api_token: "${{ secrets.KOYEB_EXAMPLES_APPS_TOKEN }}" + + - name: Build and deploy the application + uses: koyeb/action-git-deploy@v1 + with: + app-name: spring-boot-${{ github.ref_name }} + service-ports: "8000:http" + service-routes: "/:8000" + skip-cache: true diff --git a/README.md b/README.md new file mode 100644 index 0000000..a553070 --- /dev/null +++ b/README.md @@ -0,0 +1,66 @@ +[![example-spring-boot](https://github.com/koyeb/example-spring-boot/actions/workflows/deploy.yaml/badge.svg)](https://github.com/koyeb/example-spring-boot/actions) + +
+ + Logo + +

Koyeb Serverless Platform

+

+ Deploy a Spring Boot application on Koyeb +
+ Learn more about Koyeb + · + Explore the documentation + · + Discover our tutorials +

+
+ + +## About Koyeb and the Spring Boot example application + +Koyeb is a developer-friendly serverless platform to deploy apps globally. No-ops, servers, or infrastructure management. This repository contains a Spring Boot application you can deploy on the Koyeb serverless platform for testing. + +This example application is designed to show how a Spring Boot application can be deployed on Koyeb. You can follow the associated [deploy guide](https://koyeb.com/docs/deploy/spring-boot) to learn more about the application and how to extend it. + +## Getting Started + +Follow the steps below to deploy and run the Spring Boot application on your Koyeb account. + +### Requirements + +You need a Koyeb account to successfully deploy and run this application. If you don't already have an account, you can sign-up for free [here](https://app.koyeb.com/auth/signup). + +### Deploy using the Koyeb button + +The fastest way to deploy the Spring Boot application is to click the **Deploy to Koyeb** button below. + +[![Deploy to Koyeb](https://www.koyeb.com/static/images/deploy/button.svg)](https://app.koyeb.com/deploy?name=example-spring-boot&type=git&repository=koyeb%2Fexample-spring-boot&branch=main&ports=8000%3Bhttp%3B%2F) + +Clicking on this button brings you to the Koyeb App creation page with everything pre-set to launch this application. + +_To modify this application example, you will need to fork this repository. Checkout the [fork and deploy](#fork-and-deploy-to-koyeb) instructions._ + +## Fork and deploy to Koyeb + +If you want to customize and enhance this application, you need to fork this repository. + +If you used the **Deploy to Koyeb** button, you can simply link your service to your forked repository to be able to push changes. Alternatively, you can manually create the application as described below. + +On the [Koyeb Control Panel](//app.koyeb.com/apps), click the **Create App** button to go to the App creation page. + +1. Select `GitHub` as the deployment method to use. +2. In the repositories list, select the repository you just forked. +3. Specify the branch to deploy, in this case `main`. +4. Choose the builder for the repository. This repository can be built using buildpacks or a Dockerfile. +5. Give your App a name, i.e `spring-boot-on-koyeb`, and click **Deploy**. + +You will be taken to the deployment page where you can follow the build of your Spring Boot application. Once the build is completed, your application will be deployed and you will be able to access it via `-.koyeb.app`. + +## Contributing + +If you have any questions, ideas or suggestions regarding this application sample, feel free to open an [issue](https://github.com/koyeb/example-spring-boot/issues) or fork this repository and open a [pull request](https://github.com/koyeb/example-spring-boot/pulls). + +## Contact + +[Koyeb](https://www.koyeb.com) - [@gokoyeb](https://twitter.com/gokoyeb) - [Slack](http://slack.koyeb.com/)