-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (56 loc) · 1.6 KB
/
live.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
57
58
59
60
61
62
63
64
65
name: Live
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.121.1
steps:
- uses: actions/setup-node@v4
with:
node-version: 16
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- run: npm ci
- run: hugo
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: build
path: public
deploy:
concurrency:
group: live
cancel-in-progress: true
environment:
name: live
url: https://leolleo.dev
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Downloads artifact
uses: actions/download-artifact@v4
with:
name: build
path: public
- name: Publish app
uses: cloudflare/[email protected]
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
command: pages deploy --branch main --project-name blog ./public
- name: Purge cloudflare cache
run: |
curl -X POST "https://api.cloudflare.com/client/v4/zones/a5f4d54fc54af37e05218d9b4e8cd4d9/purge_cache" \
-H "Authorization: Bearer ${{ secrets.CF_API_TOKEN }}" \
-H "Content-Type: application/json" \
--data '{"purge_everything":true}'