-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (36 loc) · 1.12 KB
/
publish-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
name: Publish site to Cloudflare Pages
on:
workflow_dispatch:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
submodules: true
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: 'latest'
extended: true
- name: Build
run: hugo --minify
- name: Deploy to Cloudflare Pages
if: success()
uses: cloudflare/[email protected]
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: d73a30412652351305e3f89fd125f690
projectName: blog
directory: public
branch: main
- uses: algolia/setup-algolia-cli@master
- name: Upload Algolia Index
run: algolia indices clear ${{ secrets.ALGOLIA_INDEX_NAME }} && algolia indices batch ${{ secrets.ALGOLIA_INDEX_NAME }} public/index.json
env:
ALGOLIA_APPLICATION_ID: ${{ secrets.ALGOLIA_APP_ID }}
ALGOLIA_ADMIN_API_KEY: ${{ secrets.ALGOLIA_ADMIN_KEY }}