Skip to content

Commit

Permalink
Create github-pages.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ahandsel committed Nov 15, 2023
1 parent 768a0fb commit 4f1e318
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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

0 comments on commit 4f1e318

Please sign in to comment.