bump to trigger #8
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: Deploy in Github Pages | |
on: | |
push: | |
paths: | |
- 'slides/**' | |
permissions: | |
contents: write | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
- name: Install dependencies | |
run: npm install | |
- name: Install slidev | |
run: npm i -g @slidev/cli | |
- name: Get modified slide directories | |
id: get-dirs | |
run: | | |
# Get the list of modified slide markdown files | |
echo git show ${{ github.sha }} --name-only | |
modified_files=$(git show ${{ github.sha }} --name-only | grep "^slides/.*/.*.md$") | |
echo "Modified files: $modified_files" | |
# Initialize an empty string to store unique directories | |
modified_dirs="" | |
# Loop through modified files and extract their directories | |
for file in $modified_files; do | |
dir=$(dirname $file) | |
# Add directory to list, separated by space | |
modified_dirs="$modified_dirs $dir" | |
done | |
echo "Modified directories: $modified_dirs" | |
# Output the modified directories to be used as an environment variable | |
echo "modified_dirs=${modified_dirs}" >> $GITHUB_ENV | |
- name: Deploy 🚀 | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
branch: gh-pages # The branch the action should deploy to. | |
folder: slides/${{env.talk_title}}/dist # The folder the action should deploy. | |
target-folder: ${{ env.talk_title }} | |
clean: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |