基本上,我有一个Lektor项目,我正在try 使用Github Actions来部署到Github Pages
But发布总是失败,并显示此消息fatal: could not read Username for 'https://github.com': No such device or address
以下是完整的日志(log):
Run lektor deploy ghpages-https
/opt/hostedtoolcache/Python/3.11.3/x64/lib/python3.11/site-packages/lektor/publisher.py:657: DeprecationWarning: 'werkzeug.urls.url_parse' is deprecated and will be removed in Werkzeug 3.0. Use 'urllib.parse.urlsplit' instead.
url = urls.url_parse(str(target))
/opt/hostedtoolcache/Python/3.11.3/x64/lib/python3.11/site-packages/werkzeug/urls.py:545: DeprecationWarning: 'werkzeug.urls.URL' is deprecated and will be removed in Werkzeug 3.0. Use the 'urllib.parse' library instead.
return result_type(scheme, netloc, url, query, fragment)
Deploying to ghpages-https
Build cache: /home/runner/.cache/lektor/builds/1e169503b08805b6925804c56b34ca69
Target: ghpages+https://dzc0d3r/codeblog
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: git branch -m <name>
Initialized empty Git repository in /home/runner/work/codeblog/codeblog/temp/.deploytempbbbozlcm/scratch/.git/
From https://github.com/dzc0d3r/codeblog
* [new branch] gh-pages -> origin/gh-pages
/opt/hostedtoolcache/Python/3.11.3/x64/lib/python3.11/site-packages/werkzeug/urls.py:170: DeprecationWarning: 'werkzeug.urls.url_decode' is deprecated and will be removed in Werkzeug 2.4. Use 'urllib.parse.parse_qs' instead.
return url_decode(self.query, *args, **kwargs)
fatal: could not read Username for 'https://github.com': No such device or address
Done!
publish.yml
文件:
name: Publish
on:
push:
branches:
- main
jobs:
publish:
name: Publish site
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: "3.X"
- uses: actions/cache@v2
with:
key: ${{ github.ref }}
path: .cache
- name: Install dependencies
run: |
pip install --upgrade pip
pip install --upgrade setuptools
pip install -r requirements.txt
- name: Build site
run: |
lektor plugins reinstall
lektor build --no-prune
- name: Publish site
env:
LEKTOR_DEPLOY_USERNAME: ${{ secrets.LEKTOR_DEPLOY_USERNAME }}
LEKTOR_DEPLOY_PASSWORD: ${{ secrets.LEKTOR_DEPLOY_PASSWORD }}
run: |
lektor deploy ghpages-https
这是前codeblog.lektorproject
名:
[project]
name = codeblog
url = https://dzc0d3r.github.io/codeblog/
[servers.ghpages]
target = ghpages://dzc0d3r/codeblog
[servers.ghpages-https]
target = ghpages+https://dzc0d3r/codeblog
[packages]
lektor-minify = 1.2
lektor-disqus-comments = 0.4.1
lektor-tags = 0.3
任何 idea 、帮助、循序渐进的指导都将不胜感激