Skip to content

Update update_repo.yaml #5

Update update_repo.yaml

Update update_repo.yaml #5

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