Add Strand × Elucidate logos to closing slide #30
This file contains hidden or 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 & Deploy Slides | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - run: npm install | |
| - name: Find all slide decks | |
| id: decks | |
| run: | | |
| decks="" | |
| for f in slides/*.md; do | |
| if head -5 "$f" | grep -q "marp: true"; then | |
| decks="$decks $f" | |
| fi | |
| done | |
| echo "files=$decks" >> "$GITHUB_OUTPUT" | |
| - name: Pre-process Mermaid diagrams | |
| run: | | |
| mkdir -p .build | |
| cp -R assets .build/assets | |
| for f in ${{ steps.decks.outputs.files }}; do | |
| if grep -q '```mermaid' "$f"; then | |
| bash scripts/preprocess-mermaid.sh "$f" > ".build/$(basename "$f")" | |
| else | |
| cp "$f" ".build/$(basename "$f")" | |
| fi | |
| done | |
| - name: Build HTML, PDF, and PPTX | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| mkdir -p dist | |
| stamp=$(date -u +"%Y%m%d") | |
| for f in ${{ steps.decks.outputs.files }}; do | |
| name="$(basename "${f%.md}")" | |
| src=".build/$(basename "$f")" | |
| echo "Building $name..." | |
| npx marp --html --allow-local-files --theme-set themes/ -o "dist/${name}.html" -- "$src" | |
| npx marp --html --allow-local-files --theme-set themes/ --pdf -o "dist/${name}-${stamp}.pdf" -- "$src" | |
| npx marp --html --allow-local-files --theme-set themes/ --pptx -o "dist/${name}-${stamp}.pptx" -- "$src" | |
| done | |
| echo "All builds complete. Contents of dist:" | |
| ls -la dist/ | |
| - name: Copy assets to dist | |
| run: cp -r assets dist/ | |
| - name: Generate index page | |
| run: node scripts/generate-index.mjs | |
| - name: Create Cloudflare Pages project (if needed) | |
| continue-on-error: true | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| command: pages project create strand-slides --production-branch main | |
| - name: Deploy to Cloudflare Pages | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| command: pages deploy dist --project-name=strand-slides --commit-dirty=true |