Skip to content

deploy: napari/docs@2a7e0239aadf8443d1ccdb08c9e39e17579248df #165

deploy: napari/docs@2a7e0239aadf8443d1ccdb08c9e39e17579248df

deploy: napari/docs@2a7e0239aadf8443d1ccdb08c9e39e17579248df #165

name: Copy unversioned pages
on:
push:
branches:
- gh-pages
page_build:
workflow_dispatch:
jobs:
copy-pages:
name: Copy unversioned pages
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
steps:
- name: Clone artifacts repo
uses: actions/checkout@v4
with:
ref: "gh-pages"
- name: Copy pages
run: |
ls -la
rm -rf ./stable/developers
cp -Rv ./dev/developers/ ./stable/
rm -rf ./stable/naps
cp -Rv ./dev/naps/ ./stable/
rm -rf ./stable/release
cp -Rv ./dev/release/ ./stable/
rm -rf ./stable/roadmaps
cp -Rv ./dev/roadmaps/ ./stable/
cp -v ./dev/index.html ./stable/
find stable/developers/ -type f -exec sed -i 's+/_static+/../dev/_static+g' {} +
find stable/naps/ -type f -exec sed -i 's+/_static+/../dev/_static+g' {} +
find stable/release/ -type f -exec sed -i 's+/_static+/../dev/_static+g' {} +
find stable/roadmaps/ -type f -exec sed -i 's+/_static+/../dev/_static+g' {} +
sed -i 's+_static+../dev/_static+g' stable/index.html
STABLE=$(basename $(readlink -f ./stable))
find stable/ -type f -exec sed -i "s+DOCUMENTATION_OPTIONS.theme_switcher_version_match = 'dev';+DOCUMENTATION_OPTIONS.theme_switcher_version_match = '${STABLE}';+g" {} +
- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Copy unversioned files" --allow-empty
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages