name: github pages on: push: tags: - 'v*' jobs: deploy: runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 - name: Setup Python uses: actions/setup-python@v2 with: python-version: '3.8' - name: Set env run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - name: Show version run: echo $RELEASE_VERSION && echo ${{ env.RELEASE_VERSION }} - name: Upgrade pip run: | # install pip=>20.1 to use "pip cache dir" python3 -m pip install --upgrade pip - name: Get pip cache dir id: pip-cache run: echo "::set-output name=dir::$(pip cache dir)" - name: Install dependencies run: python3 -m pip install -r ./requirements.txt - name: Build docs run: (cd doc_src && make html) - name: Compress docs uses: montudor/action-zip@v0.1.0 with: args: zip -qq -r pyforhandbook_html_docs_${{ env.RELEASE_VERSION }}.zip ./doc_src/_build/html - name: Create release uses: actions/create-release@v1 env: github_token: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ github.ref }} release_name: Release ${{ github.ref }} draft: false prerelease: false - name: Upload docs to release uses: actions/upload-release-asset@v1 with: name: ${{ github.ref }} upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: pyforhandbook_html_docs_${{ env.RELEASE_VERSION }}.zip asset_name: pyforhandbook_html_docs_${{ env.RELEASE_VERSION }}.zip asset_content_type: application/zip