generated from uwhackweek/jupyterbook-template
-
Notifications
You must be signed in to change notification settings - Fork 89
57 lines (49 loc) · 1.66 KB
/
cron.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
name: Cron
on:
schedule:
# run this once a week (sunday midnight) to preserve cache
# https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy
- cron: '0 0 * * 0'
env:
DOCKER_IMAGE: uwhackweek/snowex:2021.09.07
jobs:
build-and-test:
if: github.repository == 'snowex-hackweek/website'
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Cache
uses: actions/cache@v2
# NOTE: change key to "jupyterbook-N+1" to force rebuilding cache
with:
path: ./book/_build
key: jupyterbook-5
- name: Pull Docker Image
run: |
docker pull $DOCKER_IMAGE
docker images
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
role-to-assume: github-actions-role
role-duration-seconds: 1800
- name: Build JupyterBook
env:
EARTHDATA_LOGIN: ${{ secrets.EARTHDATA_LOGIN }}
EARTHDATA_PASSWORD: ${{ secrets.EARTHDATA_PASSWORD }}
run: |
docker run -u root \
-e EARTHDATA_LOGIN -e EARTHDATA_PASSWORD \
-e AWS_REGION -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_SESSION_TOKEN \
-v ${{ github.workspace }}:/home/jovyan:rw \
$DOCKER_IMAGE .github/workflows/build.sh
- name: Save Build
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: build
path: book/_build/