Skip to content

Commit

Permalink
Add Slidev homepage workflow and update Slidev GH Pages workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Wiederholung committed Jan 27, 2024
1 parent 7d51b55 commit 0acb193
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 3 deletions.
47 changes: 47 additions & 0 deletions .github/slidev-homepage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Upload Exported Slidev to HomePage

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
paths:
- "$SLIDEV_PATH/**.pdf"
- ".github/workflows/slidev-homepage.yml"

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Default values for the inputs to this workflow
env:
SLIDEV_PATH: ${{ vars.SLIDEV_PATH }}

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Clone local repository
uses: actions/checkout@v4
with:
path: slidev

- name: Clone target repository
uses: actions/checkout@v4
environment: homepage
env:
SLIDE_PATH:: ${{ vars.SLIDE_PATH }}
with:
repository: ${{ vars.HOMEPAGE_REPO }}
token: ${{ secrets.GH_PAT }}
path: homepage

- name: Copy exported slidev to target repository
run: cp slidev/$SLIDEV_PATH/*.pdf homepage/$SLIDE_PATH

- name: Commit and push changes
run: |
cd homepage
git config user.name ${{ github.repository }}
git add .
git commit -m "Update slide"
git push
5 changes: 2 additions & 3 deletions .github/workflows/slidev-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:

# Default values for the inputs to this workflow
env:
SLIDEV_PATH: slidev
SLIDEV_PATH: ${{ vars.SLIDEV_PATH }}
SLIDES_NAME: slides.md
ENABLE_DOWNLOAD: fasle

Expand All @@ -26,9 +26,8 @@ concurrency:
jobs:
build:
runs-on: ubuntu-latest
environment: github-pages
environment: slidev
env:
SLIDEV_PATH: ${{ vars.SLIDEV_PATH }}
SLIDES_NAME: ${{ vars.SLIDES_NAME }}
ENABLE_DOWNLOAD: ${{ vars.ENABLE_DOWNLOAD }}
SPA_OUTPUT_DIR: _site
Expand Down

0 comments on commit 0acb193

Please sign in to comment.