This repository has been archived by the owner on Jun 5, 2024. It is now read-only.
generated from fastai/fastpages
-
Notifications
You must be signed in to change notification settings - Fork 416
86 lines (75 loc) · 2.58 KB
/
update-page.yaml
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Update Page On Push To Master
on:
push:
branches:
- master
jobs:
update-notebooks:
if: github.repository == 'github/covid19-dashboard'
runs-on: ubuntu-latest
steps:
- name: Copy Repository Contents
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '10.x'
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.6
- name: install dependencies
run: |
sudo apt-get update -y
sudo apt-get -y --force-yes install chromium-chromedriver
npm install -g [email protected] orca
pip3 install -r ./_notebooks/requirements.txt
python3 -m ipykernel install --user --name python3
sudo chmod -R 777 .
- name: update notebooks
id: update_nb
run: |
./_action_files/run_notebooks.sh
- name: Create an issue if notebook update failure occurs
if: steps.update_nb.outputs.error_bool == 'true'
uses: actions/[email protected]
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
var err = process.env.ERROR_STRING;
var run_id = process.env.RUN_ID;
github.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: "Error updating notebooks",
body: `These are the notebooks that failed to update properly: \n${err}\n\n See run [${run_id}](https://github.com/github/covid19-dashboard/actions/runs/${run_id}) for more details.`
})
env:
ERROR_STRING: ${{ steps.update_nb.outputs.error_str }}
RUN_ID: ${{ github.run_id }}
- name: convert notebooks and word docs to posts
uses: ./_action_files
- name: setup directories for Jekyll build
run: |
rm -rf _site
sudo chmod -R 777 .
- name: Jekyll build
uses: docker://hamelsmu/fastpages-jekyll
with:
args: bash -c "gem install bundler && jekyll build -V"
env:
JEKYLL_ENV: 'production'
- name: copy CNAME file into _site if CNAME exists
if: github.event_name != 'pull_request'
run: |
sudo chmod -R 777 _site/
cp CNAME _site/ 2>/dev/null || :
- name: Deploy
if: github.event_name != 'pull_request'
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.SSH_DEPLOY_KEY }}
publish_dir: ./_site
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
force_orphan: true