Update update_repo.yaml #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish to Github Pages | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Extract repository name | |
run: echo "repoName=$(echo ${{ github.repository }} | cut -d'/' -f2)" >> $GITHUB_ENV | |
- name: set Base href | |
run: sed -i "s|<base href=\".*\">|<base href=\"/${{ env.repoName }}/\">|g" build/web/index.html | |
- name: Install ZIP tool | |
run: sudo apt-get install zip | |
- name: Archive | |
run: | | |
cd build | |
mkdir artifact | |
zip -r artifact/website.zip web | |
cd .. | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
path: build/artifact/website.zip | |
- name: Deploy to Github Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./build/web |