我有一个简单的github工作流来生成我的文档,它运行gradlew命令,看起来像这样
name: MKDocs
on:
push:
branches:
- master
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: 17
distribution: 'adopt'
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Install Dependencies
run: pip install mkdocs-material
- name: Generate Docs
run: |
chmod +x ./docs.sh
chmod +x ./gradlew
./docs.sh
它给我一个错误
git没有忽略我的gradle-wrapper.jar
文件docs.sh
文件的内容
#!/bin/bash
# Fail on any error
set -ex
DOCS_ROOT=docs
[ -d $DOCS_ROOT ] && rm -r $DOCS_ROOT
mkdir $DOCS_ROOT
# Clear out the old API docs
[ -d docs/api ] && rm -r docs/api
# Build the docs with dokka
./gradlew dokkaHtml --stacktrace
# Copy README.md to docs
cp README.md ./docs/README.md
# Deploy Docs
mkdocs gh-deploy --force
1条答案
按热度按时间cu6pst1q1#
由于某种原因,我在.gitignore中有
/gradle/wrapper
,所以./gradlew
在CI中不能工作,一旦我添加了缺少的目录,一切就都正常了