|
7 | 7 |
|
8 | 8 | jobs: |
9 | 9 | build: |
10 | | - |
11 | 10 | runs-on: ubuntu-latest |
12 | 11 | strategy: |
13 | 12 | matrix: |
14 | | - python-version: [ '3.x' ] |
| 13 | + python-version: ["3.x"] |
15 | 14 | steps: |
16 | | - - uses: actions/checkout@v1 |
17 | | - - name: Configure git |
18 | | - run: | |
19 | | - git config --global user.name 'travis-ci' |
20 | | - git config --global user.email 'travis@nowhere.edu' |
21 | | - - name: Set up Python ${{ matrix.python-version }} |
22 | | - uses: actions/setup-python@v1 |
23 | | - with: |
24 | | - python-version: ${{ matrix.python-version }} |
| 15 | + - uses: actions/checkout@v1 |
| 16 | + - name: Configure git |
| 17 | + run: | |
| 18 | + git config --global user.name 'travis-ci' |
| 19 | + git config --global user.email 'travis@nowhere.edu' |
| 20 | + - name: Set up Python ${{ matrix.python-version }} |
| 21 | + uses: actions/setup-python@v1 |
| 22 | + with: |
| 23 | + python-version: ${{ matrix.python-version }} |
25 | 24 |
|
26 | | - - name: Get full Python version |
27 | | - id: full-python-version |
28 | | - shell: bash |
29 | | - run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") |
| 25 | + - name: Get full Python version |
| 26 | + id: full-python-version |
| 27 | + shell: bash |
| 28 | + run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") |
30 | 29 |
|
31 | | - - name: Install poetry |
32 | | - run: | |
33 | | - curl -O -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py |
34 | | - python get-poetry.py -y --version 1.0.10 |
35 | | - echo "::set-env name=PATH::$HOME/.poetry/bin:$PATH" |
36 | | - rm get-poetry.py |
| 30 | + - name: Install poetry |
| 31 | + run: | |
| 32 | + curl -O -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py |
| 33 | + python get-poetry.py -y --version 1.0.10 |
| 34 | + echo "PATH=${HOME}/.poetry/bin:${PATH}" >> $GITHUB_ENV |
| 35 | + rm get-poetry.py |
37 | 36 |
|
38 | | - - name: Get poetry cache paths from config |
39 | | - run: | |
40 | | - echo ::set-env name=poetry_cache_dir::$(poetry config --list | sed -n 's/.*cache-dir = //p' | sed -e 's/^"//' -e 's/"$//') |
41 | | - echo ::set-env name=poetry_virtualenvs_path::$(poetry config --list | sed -n 's/.*virtualenvs.path = .* # //p' | sed -e 's/^"//' -e 's/"$//') |
| 37 | + - name: Get poetry cache paths from config |
| 38 | + run: | |
| 39 | + echo "poetry_virtualenvs_path=$(poetry config --list | sed -n 's/.*virtualenvs.path = .* # //p' | sed -e 's/^\"//' -e 's/\"$//')" >> $GITHUB_ENV |
| 40 | + echo "poetry_virtualenvs_path=$(poetry config --list | sed -n 's/.*virtualenvs.path = .* # //p' | sed -e 's/^\"//' -e 's/\"$//')" >> $GITHUB_ENV |
42 | 41 |
|
43 | | - - name: Configure poetry |
44 | | - shell: bash |
45 | | - run: poetry config virtualenvs.in-project true |
| 42 | + - name: Configure poetry |
| 43 | + shell: bash |
| 44 | + run: poetry config virtualenvs.in-project true |
46 | 45 |
|
47 | | - - name: Set up cache |
48 | | - uses: actions/cache@v2 |
49 | | - id: cache |
50 | | - with: |
51 | | - path: | |
52 | | - .venv |
53 | | - {{ env.poetry_cache_dir }} |
54 | | - {{ env.poetry_virtualenvs_path }} |
55 | | - key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} |
| 46 | + - name: Set up cache |
| 47 | + uses: actions/cache@v2 |
| 48 | + id: cache |
| 49 | + with: |
| 50 | + path: | |
| 51 | + .venv |
| 52 | + {{ env.poetry_cache_dir }} |
| 53 | + {{ env.poetry_virtualenvs_path }} |
| 54 | + key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} |
56 | 55 |
|
57 | | - - name: Ensure cache is healthy |
58 | | - if: steps.cache.outputs.cache-hit == 'true' |
59 | | - shell: bash |
60 | | - run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv |
| 56 | + - name: Ensure cache is healthy |
| 57 | + if: steps.cache.outputs.cache-hit == 'true' |
| 58 | + shell: bash |
| 59 | + run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv |
61 | 60 |
|
62 | | - - name: Upgrade pip |
63 | | - shell: bash |
64 | | - run: poetry run python -m pip install pip -U |
| 61 | + - name: Upgrade pip |
| 62 | + shell: bash |
| 63 | + run: poetry run python -m pip install pip -U |
65 | 64 |
|
66 | | - - name: Install dependencies [w/ docs] |
67 | | - run: poetry install --extras "docs lint" |
| 65 | + - name: Install dependencies [w/ docs] |
| 66 | + run: poetry install --extras "docs lint" |
68 | 67 |
|
69 | | - - name: Build documentation |
70 | | - run: | |
71 | | - pushd docs; make SPHINXBUILD='poetry run sphinx-build' html; popd |
| 68 | + - name: Build documentation |
| 69 | + run: | |
| 70 | + pushd docs; make SPHINXBUILD='poetry run sphinx-build' html; popd |
72 | 71 |
|
73 | | - - name: Push documentation to S3 |
74 | | - uses: jakejarvis/s3-sync-action@master |
75 | | - with: |
76 | | - args: --acl public-read --follow-symlinks --delete |
77 | | - env: |
78 | | - AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} |
79 | | - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
80 | | - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
81 | | - AWS_REGION: 'us-west-1' # optional: defaults to us-east-1 |
82 | | - SOURCE_DIR: 'docs/_build/html' # optional: defaults to entire repository |
| 72 | + - name: Push documentation to S3 |
| 73 | + uses: jakejarvis/s3-sync-action@master |
| 74 | + with: |
| 75 | + args: --acl public-read --follow-symlinks --delete |
| 76 | + env: |
| 77 | + AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} |
| 78 | + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 79 | + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 80 | + AWS_REGION: "us-west-1" # optional: defaults to us-east-1 |
| 81 | + SOURCE_DIR: "docs/_build/html" # optional: defaults to entire repository |
83 | 82 |
|
84 | | - - name: Generate list of changed files for CloudFront to invalidate |
85 | | - run: | |
86 | | - pushd docs/_build/html; FILES=$(find . -name \* -print | grep html | cut -c2- | sort | uniq | tr '\n' ' '); popd |
87 | | - for file in $FILES; do |
88 | | - echo $file |
89 | | - # add bare directory to list of updated paths when we see index.html |
90 | | - [[ "$file" == *"/index.html" ]] && echo $file | sed -e 's/\/index.html$/\//' |
91 | | - done | sort | uniq | tr '\n' ' ' > .updated_files |
| 83 | + - name: Generate list of changed files for CloudFront to invalidate |
| 84 | + run: | |
| 85 | + pushd docs/_build/html; FILES=$(find . -name \* -print | grep html | cut -c2- | sort | uniq | tr '\n' ' '); popd |
| 86 | + for file in $FILES; do |
| 87 | + echo $file |
| 88 | + # add bare directory to list of updated paths when we see index.html |
| 89 | + [[ "$file" == *"/index.html" ]] && echo $file | sed -e 's/\/index.html$/\//' |
| 90 | + done | sort | uniq | tr '\n' ' ' > .updated_files |
92 | 91 |
|
93 | | - - name: Invalidate on CloudFront |
94 | | - uses: chetan/invalidate-cloudfront-action@master |
95 | | - env: |
96 | | - DISTRIBUTION: ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION }} |
97 | | - AWS_REGION: 'us-east-1' |
98 | | - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
99 | | - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
100 | | - PATHS_FROM: .updated_files |
| 92 | + - name: Invalidate on CloudFront |
| 93 | + uses: chetan/invalidate-cloudfront-action@master |
| 94 | + env: |
| 95 | + DISTRIBUTION: ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION }} |
| 96 | + AWS_REGION: "us-east-1" |
| 97 | + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 98 | + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 99 | + PATHS_FROM: .updated_files |
0 commit comments