-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (47 loc) · 1.34 KB
/
deploy.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
49
50
51
52
53
name: Deploy to GitHub pages
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: write
pages: write
repository-projects: write
env:
PROJECT_SRC: sites/logistics
BUILD_FOLDER: sites/logistics/.output/public
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
repository: drolx/ying
submodules: false
persist-credentials: false
ssh-key: ${{ secrets.YING_PRIVATE_KEY }}
- name: setup bun
uses: oven-sh/setup-bun@v2
with:
bun-version: "latest"
- run: |
bun install
cd $PROJECT_SRC
bun generate
- name: Init new repo in $BUILD_FOLDER and commit generated files
run: |
grep -rnwl "<link rel=\"prefetch\"" $BUILD_FOLDER | xargs sed -i 's$<link rel="prefetch" href="[^"]*\.\(jpg\|png\|webm\|jpeg\|ttg\|svg\|gif\)">$$g'
cd $BUILD_FOLDER
touch .nojekyll
git init
git add -A
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -m 'deploy'
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: ${{env.BUILD_FOLDER}}