-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (41 loc) · 1.19 KB
/
slidev-homepage.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
38
39
40
41
42
43
44
45
46
47
48
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
environment: homepage
env:
HOMEPAGE_REPO: ${{ vars.HOMEPAGE_REPO }}
GH_PAT: ${{ secrets.GH_PAT }}
SLIDE_PATH: ${{ vars.SLIDE_PATH }}
steps:
- name: Clone local repository
uses: actions/checkout@v4
with:
path: slidev
- name: Clone target repository
uses: actions/checkout@v4
with:
repository: $HOMEPAGE_REPO
token: $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