Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Deploy pages

on:
workflow_dispatch:
push:
branches: [main]

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 'lts/*'

- name: Setup @antfu/ni
run: npm i -g @antfu/ni

- name: Install dependencies
run: nci

- name: Build
run: bash deploy.bash /${{github.event.repository.name}}/

- name: Setup Pages
uses: actions/configure-pages@v4

- uses: actions/upload-pages-artifact@v3
with:
path: dist

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# MissingSemester-slides
# MissingSemester-slides

preview

https://wznmickey.github.io/MissingSemester-slides/shell
17 changes: 17 additions & 0 deletions deploy.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
for dir in slides/*; do
if [ -d "$dir" ]; then
nr build $dir/main.md --base $1$(echo "$dir" | sed 's/slides\///; s/\//_/g')
fi
done

mkdir dist

for dir in slides/*/dist; do
if [ -d "$dir" ]; then
source_folder=$(dirname "$dir")
target_name=$(echo "$source_folder" | sed 's/slides\///; s/\//_/g')
target_path="dist/${target_name}"
echo "Moving $dir to $target_path"
mv "$dir" "$target_path"
fi
done
Loading