-
Notifications
You must be signed in to change notification settings - Fork 1
37 lines (34 loc) · 1.27 KB
/
github-pages.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Build and Deploy
on: [push]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
if: ${{ contains(github.event.head_commit.message, 'Upload') }}
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2.3.1
- name: Set env
run: |
echo "slide=$(echo '${{ github.event.head_commit.message }}' | cut -d' ' -f 2)" >> $GITHUB_ENV
- name: Install and Build 🔧
run: |
echo ${{ env.slide }}
npm install
npm run build -- ${{ env.slide }}.md --base /${{ env.slide }}/
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@4.1.4
with:
branch: gh-pages # The branch the action should deploy to.
folder: dist # The folder the action should deploy.
target-folder: ${{ env.slide }}
clean: false
- name: Checkout for README 🛎️
uses: actions/checkout@v2.3.1
- name: Update README
run: |
echo "| [${{ env.slide }}](${{ env.slide }}.md) | <https://ahandsel.github.io/${{ env.slide }}/> |" >> README.md
- name: Commit README changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "readme: add ${{ env.slide }} link"
file_pattern: README.md