forked from yihong0618/gitblog
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (52 loc) · 1.61 KB
/
generate_site.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
54
55
56
name: Deploy static content to Pages
on:
issues:
types:
- opened
- edited
- closed
- reopened
- labeled
- unlabeled
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}
ISITE_VERSION: v0.1.3
ZOLA_VERSION: v0.17.2
USER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
BASE_URL: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Generate markdown
run: |
gh release download $ISITE_VERSION --repo kemingy/isite -p '*Linux_x86_64*' --output isite.tar.gz
tar zxf isite.tar.gz && mv isite /usr/local/bin
isite generate --user $USER --repo $REPO
gh release download $ZOLA_VERSION --repo getzola/zola -p '*linux*' --output zola.tar.gz
tar zxf zola.tar.gz && mv zola /usr/local/bin
cd output && zola build --base-url $BASE_URL
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: 'output/public'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v3