diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 31b9d9cb01f19..84e13e81b8dd4 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -20,18 +20,35 @@ jobs: - name: Create conda environment run: conda create --quiet -c conda-forge --name shpc spython + - name: Check out main + uses: "actions/checkout@v3" + with: + ref: "main" + path: "tmp-registry" + - name: Install shpc run: | export PATH="/usr/share/miniconda/bin:$PATH" source activate shpc pip install git+https://github.com/singularityhub/singularity-hpc@main - git clone https://github.com/singularityhub/shpc-registry /tmp/registry + + - name: Set Pages base URL and Registry URL + run: | + URL=$(curl -L \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ github.token }}"\ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/${{ github.repository }}/pages \ + | jq -r '.html_url') + sed -i "s|/shpc-registry|$URL|" _config.yml + sed -i "s|singularityhub/shpc-registry|${{ github.repository }}|" generate.sh - name: Generate docs run: | export PATH="/usr/share/miniconda/bin:$PATH" source activate shpc - /bin/bash generate.sh /tmp/registry + /bin/bash generate.sh ./tmp-registry + rm -r tmp-registry - name: Deploy 🚀 uses: JamesIves/github-pages-deploy-action@4.1.1