-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (42 loc) · 1.24 KB
/
deploy-ghpages.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
name: Deploy to GitHub Pages
on:
push:
workflow_dispatch:
schedule:
- cron: "0 * * * *"
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout results
uses: actions/checkout@v2
with:
ref: refs/heads/results
path: results
- name: Checkout speedlify
uses: actions/checkout@v2
with:
path: default
- name: Copy existing results
run: cp -r results/. default/_data
- name: Install npm dependencies
run: npm install
working-directory: default
- name: Build speedlify
run: |
npm run build -- --pathprefix=${GITHUB_REPOSITORY#*/}
npm run zip-results
working-directory: default
- name: Deploy to gh-pages branch
run: |
mkdir gh-pages
cp -r default/_site/* gh-pages
cd gh-pages
ORIGIN=https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }}.git
git init
git config user.name github-actions
git config user.email [email protected]
git checkout -b gh-pages
git add .
git commit -m "Deploy gh-pages"
git push -uf $ORIGIN gh-pages