Added Traffic Stop guide to first shift #12
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: Build Docusaurus | |
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 | |
id: build | |
run: | | |
npm run build 2>&1 | tee build.log | |
- name: Check for errors in log | |
id: check_log | |
run: | | |
if grep -q "compiled with errors" build.log; then | |
echo "Errors found in build log" | |
exit 1 | |
fi | |
- name: Upload build log if failed | |
uses: actions/upload-artifact@v2 | |
with: | |
name: build-log | |
path: build.log | |
- name: Post build log to PR if failed | |
if: failure() | |
run: | | |
echo "## :x: Docusaurus Build Failed" > build-summary.md | |
echo "\n### Build Log" >> build-summary.md | |
echo '```' >> build-summary.md | |
cat build.log >> build-summary.md | |
echo '```' >> build-summary.md | |
shell: bash | |
- name: Create comment with build log | |
if: failure() | |
uses: peter-evans/create-or-update-comment@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
issue-number: ${{ github.event.pull_request.number }} | |
body: | | |
$(cat build-summary.md) |