-
Notifications
You must be signed in to change notification settings - Fork 10
43 lines (36 loc) · 1.39 KB
/
workflow.yml
File metadata and controls
43 lines (36 loc) · 1.39 KB
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: Build docs
on:
push:
branches:
- master
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Build docs
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
WODBY_API_KEY: ${{ secrets.WODBY_API_KEY }}
WODBY_INSTANCE_UUID: ${{ secrets.WODBY_INSTANCE_UUID }}
CF_KEY: ${{ secrets.CF_KEY }}
CF_EMAIL: ${{ secrets.CF_EMAIL }}
CF_ZONE_ID: ${{ secrets.CF_ZONE_ID }}
VERSION: ${{ github.run_number }}
run: |
set -e
wget -qO- https://api.wodby.com/api/v1/get/cli | sh
wodby ci init "${WODBY_INSTANCE_UUID}"
echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin
wodby ci run -i wodby/mkdocs -- \
sh -c "mkdir sites && cd 1.0 && mkdocs build -d ../sites/1.0 && cd ../2.0 && mkdocs build -d ../sites/2.0"
wodby ci build --dockerfile Dockerfile -t wodby/docs:${VERSION}
wodby ci release -t wodby/docs:${VERSION}
wodby ci deploy -t wodby/docs:${VERSION}
curl -X DELETE "https://api.cloudflare.com/client/v4/zones/${CF_ZONE_ID}/purge_cache" \
-H "X-Auth-Email: ${CF_EMAIL}" \
-H "X-Auth-Key: ${CF_KEY}" \
-H "Content-Type:application/json" \
--data '{"purge_everything":true}'