笔记主要包含实现自动部署的工作流。
参考
结合了第二、三个博文中的 workflow 文件,最终实现自动化部署。Obsidian 一键上传用到了 envelope 。
我的 workflow 文件
name: Generate Hexo Blog
on: push: branches: - main # default branch
jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: token: ${{ secrets.GITHUB_TOKEN }} submodules: true - name: Use Node.js 16.x #配置node环境 uses: actions/setup-node@v2 with: node-version: '20.11.1' - name: Setup Hexo environment run: | npm install -g hexo-cli npm ci - name: Generate pages run: | hexo generate ls -R public/ # - name: Cache NPM dependencies # uses: actions/cache@v2 # with: # path: node_modules # key: ${{ runner.OS }}-npm-cache # restore-keys: | # ${{ runner.OS }}-npm-cache # - name: Install Dependencies # run: npm install # - name: Build # run: npm run build # - name: Upload Pages artifact # uses: actions/upload-pages-artifact@v2 # with: # path: ./public # deploy: # needs: build # permissions: # pages: write # id-token: write # environment: # name: github-pages # url: ${{ steps.deployment.outputs.page_url }} # runs-on: ubuntu-latest # steps: # - name: Deploy to GitHub Pages # id: deployment # uses: actions/deploy-pages@v2 - name: Deploy uses: JamesIves/github-pages-deploy-action@releases/v3 with: REPOSITORY_NAME: yohakuo/yohakuo.github.io BRANCH: html FOLDER: public
|
基本操作
git commit -m "main workflow configure"
|
git commit -m "Vault backup"
|
- 暂存更改(将它们暂存起来,然后在合并分支后再恢复)
git branch -u origin/main
|
主题
我当时配置这个主题出现了一点问题,最后是把它作为子模块工作流才能运行成<submodules: true>
问题解决
You have unmerged paths.
- 来到标红的文件进行修改,再次 push
**MERGING**
就没有了
git push -u origin --> fatal: unable to access
- 远程仓库和本地不一致,比如远程有的文件本地没有
- 查询并取消代理
git config --global http.proxy git config --global --unset http.proxy
|