-
Notifications
You must be signed in to change notification settings - Fork 38
57 lines (54 loc) · 1.66 KB
/
deploy.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
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Wait for CF Pages
id: cf-pages
uses: WalshyDev/cf-pages-await@v1
with:
accountEmail: ${{ secrets.CLOUDFLARE_ACCOUNT_EMAIL }}
apiKey: ${{ secrets.CLOUDFLARE_GLOBAL_API_KEY }}
accountId: 'c07da5a4aa8d50689311ae57df77e3a6'
project: 'the-examples-book'
# Add this if you want GitHub Deployments (see below)
githubToken: ${{ secrets.GITHUB_TOKEN }}
run-scraper:
needs: build
runs-on: ubuntu-20.04
steps:
- name: Clone TheDataMine/docs-scraper
uses: actions/checkout@v2
with:
repository: TheDataMine/docs-scraper
- name: Install pipenv
run: |
python3 -m pip install --upgrade pipenv wheel
- id: cache-pipenv
uses: actions/cache@v1
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
- name: Install dependencies
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run:
pipenv install
- name: Run docs-scraper
env:
MEILISEARCH_HOST_URL: ${{ secrets.MEILISEARCH_HOST_URL }}
MEILISEARCH_API_KEY: ${{ secrets.MEILISEARCH_API_KEY }}
run: |
pipenv run ./docs_scraper ./the-examples-book.config.json
purge-cf-cache:
needs: build
runs-on: ubuntu-20.04
steps:
- name: Purge Cloudflare cache
uses: jakejarvis/cloudflare-purge-action@master
env:
CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE }}
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}