ci(workflows): Migrate to self-hosted runners
Some checks failed
Deploy MkDocs / deploy (push) Has been cancelled
Some checks failed
Deploy MkDocs / deploy (push) Has been cancelled
Switch GitHub Actions workflows (`docs`, `mirror`, `pypi`) from `ubuntu-latest` to `self-hosted` runners. This change also updates the Python environment setup in `docs.yml` and `pypi.yml` to manually create and activate a virtual environment (`venv`). This provides more control over the Python environment on self-hosted machines and ensures dependencies are isolated.
This commit is contained in:
parent
675aab39ce
commit
f7a47619ac
15
.github/workflows/docs.yml
vendored
15
.github/workflows/docs.yml
vendored
@ -21,7 +21,7 @@ on:
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: self-hosted
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
@ -30,12 +30,14 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.13'
|
||||
run: |
|
||||
python -m venv venv
|
||||
source venv/bin/activate
|
||||
pip install --upgrade pip
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
source venv/bin/activate
|
||||
pip install mkdocs mkdocs-material
|
||||
|
||||
- name: Configure Git author from GitHub Actions metadata
|
||||
@ -46,5 +48,6 @@ jobs:
|
||||
- name: Deploy docs
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: mkdocs gh-deploy --force --clean
|
||||
|
||||
run: |
|
||||
source venv/bin/activate
|
||||
mkdocs gh-deploy --force --clean
|
||||
|
5
.github/workflows/mirror.yml
vendored
5
.github/workflows/mirror.yml
vendored
@ -3,11 +3,12 @@ name: Mirror to Gitea
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master # or change to your default branch
|
||||
- master
|
||||
|
||||
jobs:
|
||||
mirror:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: self-hosted
|
||||
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
|
17
.github/workflows/pypi.yml
vendored
17
.github/workflows/pypi.yml
vendored
@ -3,14 +3,14 @@ name: Publish to PyPI
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*' # only trigger on version tags like v1.0.0
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
build-and-publish:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: self-hosted
|
||||
|
||||
permissions:
|
||||
id-token: write # required for trusted publishing, if used
|
||||
id-token: write
|
||||
contents: read
|
||||
|
||||
steps:
|
||||
@ -27,17 +27,19 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.13'
|
||||
run: |
|
||||
python -m venv venv
|
||||
source venv/bin/activate
|
||||
pip install --upgrade pip
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
source venv/bin/activate
|
||||
pip install build twine
|
||||
|
||||
- name: Build package
|
||||
run: |
|
||||
source venv/bin/activate
|
||||
python -m build
|
||||
|
||||
- name: Publish to PyPI
|
||||
@ -45,4 +47,5 @@ jobs:
|
||||
TWINE_USERNAME: __token__
|
||||
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
|
||||
run: |
|
||||
source venv/bin/activate
|
||||
python -m twine upload dist/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user