Skip to content

Github Actions Error #15

@wiktormalyska

Description

@wiktormalyska

Hi! i have customised your repo to my needs, i have git backup of obsidian vault and i didn't want to move any of my notes files so i made script to do it for me and deploy it on web branch

GitHub Actions

name: Obsidian Notes on GitHub Pages
run-name: ${{ github.actor }} is deploying Obsidian Notes via GitHub Actions 🚀

on:   
  push:
    branches:
      - master

jobs:
  Generate_Static_HTML:
    runs-on: ubuntu-latest
    steps:
      - name: Get Tree
        run: |
          sudo apt-get install tree
      - name: Checkout repository
        run: |
          git config --global user.email "actions@github.com"
          git config --global user.name "GitHub Actions"
          git clone https://x-access-token:${{ secrets.PAT_TOKEN }}@github.com/wiktormalyska/University-Notes.git


      - name: Create and reset 'web' branch
        run: |
          cd University-Notes
          git checkout -b web
          git rm -fr *

      - name: Add and fetch from 'oth' repository
        run: |
          git clone https://github.com/UlisseMini/oth.git
          cd oth
          find . -mindepth 1 -maxdepth 1 ! -name '.git' ! -name '.github' -exec mv -t ../ \{\} +
          cd ..
          rm -rf oth
          rm README.md

      - name: Clean and populate 'notes' directory with 'master' content
        run: |
          cd notes
          rm -fr *
          git clone https://x-access-token:${{ secrets.PAT_TOKEN }}@github.com/wiktormalyska/University-Notes.git
          cd University-Notes/
          find . -mindepth 1 -maxdepth 1 ! -name '.git' ! -name '.github' -exec mv -t ../ \{\} +
          cd ..
          rm -rf University-Notes

      - name: Commit and push changes to 'web' branch
        run: |
          pwd
          tree -a
          cp -r University-Notes/.git .
          rm -fdr University-Notes/
          git add .
          git commit -m "Update web branch with content from oth and master"
          git push https://x-access-token:${{ secrets.PAT_TOKEN }}@github.com/${{ github.repository }} web --force
  Deploy_web_to_GitHub_Pages:
    runs-on: ubuntu-latest
    needs: Generate_Static_HTML
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          ref: web
          persist-credentials: false # build doesn't need git access
          submodules: false  
      - name: Remove .gitmodules if exists
        run: |
          if [ -f .gitmodules ]; then
            git rm --cached .gitmodules
            rm .gitmodules
            git config -f .git/config --remove-section submodule || true
            git add .
            git commit -m "Removed submodule configuration"
          fi
      - name: Install dependencies
        uses: borales/actions-yarn@v3
        with:
          cmd: install

      - name: Build site
        uses: borales/actions-yarn@v3
        with:
          cmd: build

      - name: Deploy
        uses: JamesIves/github-pages-deploy-action@3.6.2
        with:
          GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
          BRANCH: gh-pages
          FOLDER: out

Error:

file:///github/workspace/node_modules/fault/index.js:39
    return new Constructor(reason)
           ^
Error: Unknown language: `pascal` is not registered
    at FormattedError (file:///github/workspace/node_modules/fault/index.js:39:12)
    at Object.highlight (file:///github/workspace/node_modules/lowlight/lib/core.js:50:11)
    at file:///github/workspace/node_modules/rehype-highlight/lib/index.js:105:22
    at overload (file:///github/workspace/node_modules/unist-util-visit/index.js:50:16)
    at node (element<code>) (file:///github/workspace/node_modules/unist-util-visit-parents/index.js:104:31)
    at node (element<pre>) (file:///github/workspace/node_modules/unist-util-visit-parents/index.js:121:79)
    at node (root) (file:///github/workspace/node_modules/unist-util-visit-parents/index.js:121:79)
    at visitParents (file:///github/workspace/node_modules/unist-util-visit-parents/index.js:61:30)
    at visit (file:///github/workspace/node_modules/unist-util-visit/index.js:42:7)
    at file:///github/workspace/node_modules/rehype-highlight/lib/index.js:69:5
Node.js v20.16.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions