TangHuan b46f6942a4
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
init-cicd
2025-04-02 10:21:32 +08:00

43 lines
1.5 KiB
YAML

name: Gitea Actions Demo
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
on: [push]
jobs:
Explore-Gitea-Actions:
runs-on: ubuntu-latest
steps:
- name: 克隆代码
uses: https://gitea.com/actions/checkout@v4
- name: 下载jdk
run: |
download_url="https://dragonwell.oss-cn-shanghai.aliyuncs.com/21.0.6.0.6%2B7-test-dragonwell_extended/Alibaba_Dragonwell_Extended_21.0.6.0.6.7_x64_linux.tar.gz"
wget -O $RUNNER_TEMP/java_package.tar.gz $download_url
- uses: https://gitea.com/actions/setup-java@v4
name: 准备jdk
cache: "maven"
with:
distribution: 'jdkfile'
jdkFile: ${{ runner.temp }}/java_package.tar.gz
java-version: '21.0.6'
architecture: x64
# 缓存 Maven 依赖
- name: Cache Maven packages
uses: https://gitea.com/actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: 编译
run: chmod +x ./mvnw && ./mvnw -s settings.xml clean install -U -DskipTests -Pprod
- name: 打包
run: ./mvnw spring-boot:build-image-no-fork
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: |
ls ${{ gitea.workspace }}
- run: echo "🍏 This job's status is ${{ job.status }}."