Skip to content

Commit

Permalink
TARGET_FOLDER is not an env, so we need to give it a value.
Browse files Browse the repository at this point in the history
  • Loading branch information
guiferviz committed May 30, 2020
1 parent 7aac9fc commit 7d886bc
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/docs_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,50 @@ on:
release:
types: [ created ]

env:
VERSION_FILE: recipipe/_version.py

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Update version
run: |
# Get version numbers form GITHUB_REF (without the leading "v").
VERSION=$(sed -n 's/.*\/v\(.*\)/\1/p' <<< $GITHUB_REF)
# Substitute value in _version file.
sed -i "s/0.0.0/$VERSION/" recipipe/_version.py
sed -i "s/0.0.0/$VERSION/" $VERSION_FILE
# Save a version env variable to reuse it later (leading "v" included).
# This variable is used by JamesIves/github-pages-deploy-action
# and indicates the output folder where the docs are going to be saved.
echo ::set-env name=TARGET_FOLDER::v$VERSION
echo ::set-env name=RELEASE_VERSION::v$VERSION
- name: Install dependencies
run: |
sudo apt-get install graphviz
pip install -r requirements_dev.txt
- name: Generate pre-build data
run: |
cd doc/
make generate_data
- name: Build docs
run: |
cd doc/
make html
touch _build/html/.nojekyll # needed to deploy folders starting with "_" in gh-pages
- name: Deploy to gh-pages
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
BRANCH: gh-pages # the branch the action should deploy to.
FOLDER: doc/_build/html # the folder the action should deploy.
# Output folder where the docs are going to be saved.
TARGET_FOLDER: ${{ env.RELEASE_VERSION }}

0 comments on commit 7d886bc

Please sign in to comment.