Skip to content

Python 环境配置从零开始: uv、pdm 和 VSCode 的最佳实践 #72

Python 环境配置从零开始: uv、pdm 和 VSCode 的最佳实践

Python 环境配置从零开始: uv、pdm 和 VSCode 的最佳实践 #72

Workflow file for this run

name: Generate Github_blog site
on:
workflow_dispatch:
issues:
types: [opened, edited]
issue_comment:
types: [created, edited]
push:
branches:
- main
paths:
- main.py
jobs:
sync:
name: Generate Site
runs-on: ubuntu-latest
if: github.repository_owner_id == github.event.issue.user.id || github.event_name == 'push'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: pip
cache-dependency-path: "requirements.txt"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
- name: Generate contents
run: |
source venv/bin/activate
python main.py ${{ secrets.G_T }} ${{ github.repository }}
- name: Push contents
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add contents
git commit -a -m 'update new blog' || echo "nothing to commit"
git push || echo "nothing to push"