Compare commits
2 Commits
49401a8d09
...
ac804385c9
| Author | SHA1 | Date | |
|---|---|---|---|
| ac804385c9 | |||
| 823b1182be |
@@ -1,19 +1,46 @@
|
|||||||
name: Gitea Actions Demo
|
name: Build and Deploy Spring Boot Server
|
||||||
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
|
||||||
on: [push]
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- dev
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Explore-Gitea-Actions:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: self-hosted
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."
|
# 1. Checkout the code
|
||||||
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
|
- name: Checkout code
|
||||||
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
|
uses: actions/checkout@v2
|
||||||
- name: Check out repository code
|
|
||||||
uses: actions/checkout@v4
|
# 2. Set up Java and Maven
|
||||||
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
|
- name: Set up JDK
|
||||||
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
|
uses: actions/setup-java@v3
|
||||||
- name: List files in the repository
|
with:
|
||||||
|
java-version: "17"
|
||||||
|
|
||||||
|
- name: Verify Maven installation
|
||||||
run: |
|
run: |
|
||||||
ls ${{ gitea.workspace }}
|
mvn -version
|
||||||
- run: echo "🍏 This job's status is ${{ job.status }}."
|
|
||||||
|
# 3. Build the Spring Boot application
|
||||||
|
- name: Build Spring Boot Application
|
||||||
|
run: |
|
||||||
|
mvn clean package -DskipTests
|
||||||
|
|
||||||
|
# 4. Set up Docker
|
||||||
|
- name: Set up Docker
|
||||||
|
run: |
|
||||||
|
docker --version
|
||||||
|
docker-compose --version
|
||||||
|
|
||||||
|
# 5. Build the Docker image using docker-compose
|
||||||
|
- name: Build and Package Docker Image
|
||||||
|
run: |
|
||||||
|
docker-compose build
|
||||||
|
|
||||||
|
# 6. Start the application with dependencies
|
||||||
|
- name: Start the Docker Compose Application
|
||||||
|
run: |
|
||||||
|
docker-compose up -d
|
||||||
|
|||||||
Reference in New Issue
Block a user