-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (37 loc) · 1.06 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
name: Deploy to Github pages
on:
push:
branches: [main]
permissions:
contents: write
env:
BUILD_FOLDER: .output/public
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Generate static ...
uses: actions/setup-node@v3
with:
node-version: "16"
# cache: 'yarn'
- run: |
# yarn install
# yarn generate
touch .gitignore
- 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\|svg\|gif\)">$$g'
cd $BUILD_FOLDER
touch .nojekyll
git init
git add -A
git config --local user.email "[email protected]"
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}}