-
Notifications
You must be signed in to change notification settings - Fork 90
66 lines (57 loc) · 1.88 KB
/
test.yaml
File metadata and controls
66 lines (57 loc) · 1.88 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Test
on:
pull_request_target:
types: [labeled, synchronize]
paths:
- 'book/**'
- '.github/workflows/test.yaml'
- '.binder/**'
branches:
- main
env:
DOCKER_IMAGE: uwhackweek/snowex:2021.09.07
jobs:
build-and-test:
runs-on: ubuntu-20.04
# This workflow accesses secrets and checks out a PR, so only run if labelled
# https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
if: contains(github.event.pull_request.labels.*.name, 'preview')
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- 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:
# Warning: careful exposing secrets in scripts
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/