Add UTF8String, change codes from array of html texts to `hljs.high…
#25
This file contains hidden or 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: build_page | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - dev | |
| permissions: | |
| actions: write | |
| contents: write | |
| jobs: | |
| build_page: | |
| runs-on: ubuntu-latest | |
| name: publish | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Checkout GitHub Pages | |
| uses: actions/checkout@v3 | |
| with: | |
| ref: gh-pages | |
| path: gh-pages | |
| - name: Clean files | |
| working-directory: gh-pages | |
| run: | | |
| if [ "${{ github.ref_name }}" = "main" ]; then | |
| git rm -rf `find * | grep -v "^dev\(/\|$\)"`; | |
| else | |
| if [ -d gh-pages/dev ]; then | |
| git rm -rf dev; | |
| fi | |
| fi | |
| - name: Copy Files | |
| run: | | |
| if [ "${{ github.ref_name }}" = "main" ]; then | |
| cp -r `find * | grep -v "^gh-pages\(/\|$\)"` gh-pages/; | |
| else | |
| if [ ! -d gh-pages/dev ]; then | |
| mkdir gh-pages/dev; | |
| fi | |
| cp -r `find * | grep -v "^gh-pages\(/\|$\)"` gh-pages/dev/; | |
| fi | |
| - name: Commit files | |
| working-directory: gh-pages | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| if [ "${{ github.ref_name }}" = "main" ]; then | |
| git add *; | |
| else | |
| git add dev/*; | |
| fi | |
| git commit -m "[${{ github.ref_name }}] ${{ github.event.head_commit.message }}" -a | |
| - name: Push changes | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| directory: gh-pages | |
| branch: gh-pages |