diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index 0c0143cc..5277db39 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -173,7 +173,7 @@ jobs: continue-on-error: true with: ref: gh-pages - path: _site/ + path: gh-pages/ - name: Download temporary Pages artifact uses: actions/download-artifact@v3 @@ -182,7 +182,7 @@ jobs: path: _new_site/ - name: Add new docs to site - run: hexdoc_merge --source _new_site --dest _site --release "${{ needs.build.outputs.release == true }}" + run: hexdoc_merge --source _new_site --dest gh-pages/docs --release "${{ needs.build.outputs.release == true }}" - name: Fix permissions run: | @@ -194,7 +194,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: github-pages - path: _site/ + path: gh-pages/docs deploy-pages: runs-on: ubuntu-latest @@ -204,6 +204,7 @@ jobs: contents: write steps: + - uses: actions/checkout@v3 - name: Download Pages artifact uses: actions/download-artifact@v3 with: @@ -214,3 +215,4 @@ jobs: uses: JamesIves/github-pages-deploy-action@v4 with: folder: _site + target-folder: docs diff --git a/doc/src/hexdoc/hexdoc_merge.py b/doc/src/hexdoc/hexdoc_merge.py index 7f535044..457f4e81 100644 --- a/doc/src/hexdoc/hexdoc_merge.py +++ b/doc/src/hexdoc/hexdoc_merge.py @@ -46,7 +46,7 @@ def main(): if args.release: # remove current latest-released book in the destination for path in args.dest.iterdir(): - if path.name not in ["v", "meta"]: + if path.name not in ["v", "meta", "dist", ".git"]: shutil.rmtree(path) new_sitemap = defaultdict[str, dict[str, str]](dict) @@ -56,10 +56,10 @@ def main(): new_sitemap[marker.version][marker.lang] = marker.path # delete the corresponding directory in the destination - shutil.rmtree( - args.dest / marker_path.parent.relative_to(args.source), - ignore_errors=True, - ) + marker_dest_dir = args.dest / marker_path.parent.relative_to(args.source) + shutil.rmtree(marker_dest_dir, ignore_errors=True) + + marker_path.unlink() sitemap_path = args.dest / "meta" / "sitemap.json"