Skip to content

Added binary compilation for macos and linux #66

Added binary compilation for macos and linux

Added binary compilation for macos and linux #66

on:
push:
branches: [ main, master ]
pull_request:
env:
PYTHONUNBUFFERED: "1"
PYTHONPATH: .
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
# -------------------------------------------------------
# TEST JOB
# -------------------------------------------------------
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- run: pytest -q
# -------------------------------------------------------
# BUILD DOCS (MkDocs → public/)
# -------------------------------------------------------
docs-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: |
python -m pip install --upgrade pip
pip install mkdocs mkdocs-shadcn mkdocs-material mkdocstrings mkdocstrings-python pymdown-extensions mkdocs-bootstrap4
- name: Build MkDocs site into public/
run: |
cd docs
mkdocs build --site-dir ../public
- name: Upload public/ as artifact
uses: actions/upload-artifact@v4
with:
name: public
path: public/
if-no-files-found: error
# -------------------------------------------------------
# DEPLOY TO GITHUB PAGES (publish public/)
# -------------------------------------------------------
docs-deploy:
runs-on: ubuntu-latest
needs: docs-build
if: github.event_name == 'push'
steps:
- name: Download public artifact
uses: actions/download-artifact@v4
with:
name: public
path: public
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ github.workspace }}/public
# -------------------------------------------------------
# DOCKER BUILD JOB
# -------------------------------------------------------
docker:
runs-on: ubuntu-latest
needs: [test]
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=sha,prefix={{branch}}-
type=raw,value=latest,enable={{is_default_branch}}
- uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}