diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 8b44b0f..8e32f91 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -22,11 +22,14 @@ jobs: with: node-version: 20 + - name: Install yarn + run: npm install -g yarn + - name: Install dependencies - run: npm install + run: yarn install - name: Build site - run: npm run build + run: yarn build - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v3 diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml new file mode 100644 index 0000000..3c660b1 --- /dev/null +++ b/.github/workflows/pr-check.yml @@ -0,0 +1,56 @@ +name: Check Documentation Build + +on: + pull_request: + branches: + - main + - gh-pages + +jobs: + check-build: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: 20 + + - name: Install yarn + run: npm install -g yarn + + - name: Install dependencies + run: yarn install + + - name: Build site + run: yarn build + + - name: Check build output + run: | + if [ ! -d "build" ]; then + echo "Build directory not found. Build failed." + exit 1 + fi + echo "Build completed successfully!" + + - name: Comment PR + uses: actions/github-script@v6 + with: + script: | + const buildStatus = process.env.BUILD_STATUS === 'success' ? '✅' : '❌'; + const message = `${buildStatus} Documentation build check completed.`; + + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: message + }); + env: + BUILD_STATUS: ${{ job.status }} \ No newline at end of file