Skip to content

Commit

Permalink
Add explicit dist merge step
Browse files Browse the repository at this point in the history
  • Loading branch information
juntyr committed Nov 1, 2024
1 parent a645465 commit e34fdb4
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,32 @@ jobs:
cp -r pyodide/dist static/pyodide
rm -rf static/pyodide/*-tests.tar
rm -f static/pyodide/tsconfig.tsbuildinfo
jupyter lite build --output-dir dist
cp ./_headers dist/
cp static/favicons/favicon.ico dist/
find dist/ -name favicon.ico | xargs -L1 cp -f static/favicons/favicon.ico
jupyter lite build --output-dir staging
cp ./_headers staging/
cp static/favicons/favicon.ico staging/
find staging/ -name favicon.ico | xargs -L1 cp -f static/favicons/favicon.ico
rm -rf static
- name: Get the current branch name
uses: tj-actions/branch-names@v8
id: branch
- name: Compute the current version name
run: echo "VERSION=${{ steps.branch.outputs.current_branch || steps.branch.outputs.tag }}" >> $GITHUB_ENV
- name: Checkout the previous dist branch
uses: actions/checkout@v4
with:
ref: dist
path: dist
continue-on-error: ${{ github.event_name != 'release' }}
- name: Merge the different dist versions
run: |
mkdir -p dist
rm -rf dist/${{ env.VERSION }}
mv staging dist/${{ env.VERSION }}
- name: Deploy to dist branch
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: dist
publish_dir: ./dist
destination_dir: ${{ steps.branch.outputs.current_branch || steps.branch.outputs.tag }}
keep_files: false
force_orphan: true

0 comments on commit e34fdb4

Please sign in to comment.