From e22aa788a5da78f62e9b25c666a6701582812856 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Mon, 23 Mar 2026 10:52:30 -0500 Subject: migrate ci to sourcehut; add ruff to build.py --- .build.yml | 34 +++++++++++++++++++ .builds/deploy.yml | 34 ------------------- .github/workflows/deploy.yml | 68 -------------------------------------- .github/workflows/docker-build.yml | 41 ----------------------- .github/workflows/ruff.yml | 42 ----------------------- Dockerfile | 31 ----------------- 6 files changed, 34 insertions(+), 216 deletions(-) create mode 100644 .build.yml delete mode 100644 .builds/deploy.yml delete mode 100644 .github/workflows/deploy.yml delete mode 100644 .github/workflows/docker-build.yml delete mode 100644 .github/workflows/ruff.yml delete mode 100644 Dockerfile diff --git a/.build.yml b/.build.yml new file mode 100644 index 0000000..120780f --- /dev/null +++ b/.build.yml @@ -0,0 +1,34 @@ +image: debian/bookworm + +packages: + - emacs-nox + - python3 + - python3-pip + - rsync + - openssh-client + +sources: + - https://git.sr.ht/~ccleberg/cleberg.net + +secrets: + - 303fbd30-2970-4d18-b88b-0f6abf822ea5 + +environment: + ENV: prod + BUILD: "true" + +tasks: + - setup: | + pip install --break-system-packages uv + curl -sSfL https://github.com/tdewolff/minify/releases/latest/download/minify_linux_amd64.tar.gz \ + | tar -xz -C ~/.local/bin minify + - build: | + cd cleberg.net + uv run build.py + - deploy: | + cd cleberg.net + chmod 600 ~/.ssh/id_rsa + rsync -r --delete-before \ + -e "ssh -o StrictHostKeyChecking=no" \ + .build/ \ + homelab:/var/www/cleberg.net/ diff --git a/.builds/deploy.yml b/.builds/deploy.yml deleted file mode 100644 index 62588ae..0000000 --- a/.builds/deploy.yml +++ /dev/null @@ -1,34 +0,0 @@ -image: debian/bookworm - -packages: - - emacs-nox - - python3 - - python3-pip - - rsync - - openssh-client - -sources: - - https://git.sr.ht/~ccleberg/cleberg.net - -secrets: - - # ~/.ssh/id_rsa, has write access to server - -environment: - ENV: prod - BUILD: "true" - -tasks: - - setup: | - pip install --break-system-packages uv - curl -sSfL https://github.com/tdewolff/minify/releases/latest/download/minify_linux_amd64.tar.gz \ - | tar -xz -C ~/.local/bin minify - - build: | - cd cleberg.net - uv run build.py - - deploy: | - cd cleberg.net - chmod 600 ~/.ssh/id_rsa - rsync -r --delete-before \ - -e "ssh -o StrictHostKeyChecking=no" \ - .build/ \ - homelab:/var/www/cleberg.net/ diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index 27edbc7..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: Build and Deploy - -on: - push: - branches: - - main - paths-ignore: - - '.github/**' - - 'screenshots/**' - - 'utils/**' - - 'LICENSE' - - 'README.org' - -jobs: - build-job: - runs-on: ubuntu-latest - container: - image: ghcr.io/ccleberg/cleberg.net:main - - steps: - - name: Checkout code - uses: actions/checkout@v6 - - - name: Run Build - env: - ENV: "prod" - BUILD: "true" - DEPLOY: "false" - run: | - echo "Environment is ready. Running build..." - uv run build.py - - - name: Upload Build Artifacts - uses: actions/upload-artifact@v6 - with: - name: build-output - path: ${{ github.workspace }}/.build/ - include-hidden-files: true - - deploy-job: - runs-on: ubuntu-latest - needs: build-job - environment: production - container: - image: ghcr.io/ccleberg/cleberg.net:main - - steps: - - name: Checkout code - uses: actions/checkout@v6 - - - name: Download Build Artifacts - uses: actions/download-artifact@v6 - with: - name: build-output - path: ${{ github.workspace }}/.build/ - - - name: Setup SSH and Deploy - env: - SERVER_IP: ${{ secrets.SERVER_IP }} - SERVER_USER: ${{ secrets.SERVER_USER }} - SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} - run: | - eval $(ssh-agent -s) - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - - rsync -avz --delete \ - -e "ssh -p ${{ secrets.SSH_PORT }} -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" \ - .build/ \ - $SERVER_USER@$SERVER_IP:/var/www/cleberg.net/ diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml deleted file mode 100644 index b3d0455..0000000 --- a/.github/workflows/docker-build.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Build and Push Docker Image - -on: - push: - branches: [ "main" ] - paths: - - 'Dockerfile' - - 'requirements.txt' - - '.github/workflows/docker-build.yml' - -jobs: - build: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Log in to GHCR - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata - id: meta - uses: docker/metadata-action@v5 - with: - images: ghcr.io/${{ github.repository }} - - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml deleted file mode 100644 index 1c0fbea..0000000 --- a/.github/workflows/ruff.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Ruff - -on: - push: - branches: [ "main" ] - paths: - - '**.py' - pull_request: - branches: [ "main" ] - paths: - - '**.py' - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.x"] - steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - ref: ${{ github.event.pull_request.head.ref }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install pandas dash plotly.express - - name: Install Ruff - uses: astral-sh/ruff-action@v3.2.2 - - name: Ruff Actions - run: | - ruff check --fix - ruff format - - name: Add and Commit - uses: EndBug/add-and-commit@v9 - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - default_author: github_actions - pathspec_error_handling: ignore diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index de87df9..0000000 --- a/Dockerfile +++ /dev/null @@ -1,31 +0,0 @@ -FROM python:3.12-slim - -ENV DEBIAN_FRONTEND=noninteractive \ - HOMEBREW_NO_AUTO_UPDATE=1 \ - PATH="/home/linuxbrew/.linuxbrew/bin:${PATH}" - -RUN apt-get update && apt-get install -y --no-install-recommends \ - curl \ - git \ - procps \ - build-essential \ - ca-certificates \ - openssh-client \ - && rm -rf /var/lib/apt/lists/* - -RUN useradd -m -s /bin/bash linuxbrew -USER linuxbrew -WORKDIR /home/linuxbrew - -RUN /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - -RUN brew install emacs rsync uv minify - -RUN mkdir -p ~/.config/emacs/.local/straight/repos && \ - cd ~/.config/emacs/.local/straight/repos && \ - git clone --depth 1 https://github.com/emacsorphanage/htmlize.git && \ - git clone --depth 1 https://github.com/emacs-love/templatel.git && \ - git clone --depth 1 https://github.com/emacs-love/weblorg.git - -USER root -WORKDIR /builds -- cgit v1.2.3