bork #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '16' | |
- name: Install dependencies | |
run: npm install | |
- name: Build Docusaurus site | |
run: | | |
npm run build > build-log.txt 2>&1 || true | |
- name: Upload build log | |
if: failure() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: build-log | |
path: build-log.txt | |
- name: Post build log comment | |
if: failure() | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
LOG_URL="${{ github.server_url }}/${{ github.repository }}/suites/${{ github.run_id }}/artifacts" | |
COMMENT="Build failed. [View log](${LOG_URL})" | |
curl -s -X POST -H "Authorization: token $GITHUB_TOKEN" \ | |
-d "{\"body\": \"$COMMENT\"}" \ | |
${{ github.event.pull_request.comments_url }} |