generated from uwhackweek/docker-template
-
Notifications
You must be signed in to change notification settings - Fork 4
67 lines (57 loc) · 2.16 KB
/
PR.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
58
59
60
61
62
63
64
65
66
67
name: BuildAndTest
on: [pull_request]
env:
DOCKER_IMAGE: uwhackweek/snowex
jobs:
build-image-without-pushing:
runs-on: ubuntu-20.04
steps:
- name: Checkout PR
uses: actions/checkout@v2
- name: Build Only
uses: jupyterhub/repo2docker-action@master
with:
NO_PUSH: 'true'
IMAGE_NAME: ${{ env.DOCKER_IMAGE }}
#MYBINDERORG_TAG: ${{ github.event.pull_request.head.ref }} #clutters output log
- name: Report Image Size and Conda Packages
run: |
docker images
docker run ${{ env.DOCKER_IMAGE }}:latest conda list --export
docker run ${{ env.DOCKER_IMAGE }}:latest conda list --explicit > conda-linux-64.lock
- name: Save conda lockfile
uses: actions/upload-artifact@v2
with:
name: lockfile
path: conda-linux-64.lock
- name: Checkout JupyterBook Website
uses: actions/checkout@v2
with:
repository: snowex-hackweek/website
- 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: 2400
# NOTE: this gets picked up b/c of the docker run -v mount
- name: Configure NASA Earthdata Login
run: |
echo "machine urs.earthdata.nasa.gov login ${{ secrets.EARTHDATA_LOGIN }} password ${{ secrets.EARTHDATA_PASSWORD }}" > .netrc
chmod 0600 .netrc
# NOTE github actions id: uid=1001(runner) gid=121(docker) groups=121(docker),4(adm),101(systemd-journal)
# Docker volume mount requires uid matching host, so we change from default (jovyan uid=1000)
- name: Build JupyterBook
run: |
docker run -u 1001 \
-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 jb build book
- name: Save Build
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: build
path: book/_build/