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:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: self-hosted
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
|
||||||
@ -30,12 +30,14 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5
|
run: |
|
||||||
with:
|
python -m venv venv
|
||||||
python-version: '3.13'
|
source venv/bin/activate
|
||||||
|
pip install --upgrade pip
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
|
source venv/bin/activate
|
||||||
pip install mkdocs mkdocs-material
|
pip install mkdocs mkdocs-material
|
||||||
|
|
||||||
- name: Configure Git author from GitHub Actions metadata
|
- name: Configure Git author from GitHub Actions metadata
|
||||||
@ -46,5 +48,6 @@ jobs:
|
|||||||
- name: Deploy docs
|
- name: Deploy docs
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
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:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master # or change to your default branch
|
- master
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
mirror:
|
mirror:
|
||||||
runs-on: ubuntu-latest
|
runs-on: self-hosted
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v3
|
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:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- 'v*' # only trigger on version tags like v1.0.0
|
- 'v*'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-publish:
|
build-and-publish:
|
||||||
runs-on: ubuntu-latest
|
runs-on: self-hosted
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
id-token: write # required for trusted publishing, if used
|
id-token: write
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@ -27,17 +27,19 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5
|
run: |
|
||||||
with:
|
python -m venv venv
|
||||||
python-version: '3.13'
|
source venv/bin/activate
|
||||||
|
pip install --upgrade pip
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
source venv/bin/activate
|
||||||
pip install build twine
|
pip install build twine
|
||||||
|
|
||||||
- name: Build package
|
- name: Build package
|
||||||
run: |
|
run: |
|
||||||
|
source venv/bin/activate
|
||||||
python -m build
|
python -m build
|
||||||
|
|
||||||
- name: Publish to PyPI
|
- name: Publish to PyPI
|
||||||
@ -45,4 +47,5 @@ jobs:
|
|||||||
TWINE_USERNAME: __token__
|
TWINE_USERNAME: __token__
|
||||||
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
|
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
|
source venv/bin/activate
|
||||||
python -m twine upload dist/*
|
python -m twine upload dist/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user