diff --git a/.github/workflows/docs_release.yml b/.github/workflows/docs_release.yml index 3d4c6c1..2a18d9e 100644 --- a/.github/workflows/docs_release.yml +++ b/.github/workflows/docs_release.yml @@ -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 }}