Files
nodarium/.gitea/workflows/deploy.yaml
Max Richter abaf5245d3
Some checks failed
🏗️ Build and Deploy / lint (push) Has been cancelled
🏗️ Build and Deploy / format (push) Has been cancelled
🏗️ Build and Deploy / typecheck (push) Has been cancelled
🏗️ Build and Deploy / build_and_deploy (push) Has been cancelled
🏗️ Build and Deploy / setup (push) Has been cancelled
feat(ci): run on every branch
2026-02-02 16:51:20 +01:00

116 lines
3.0 KiB
YAML

name: 🏗️ Build and Deploy
on:
push:
branches: ["*"]
env:
PNPM_CACHE_FOLDER: .pnpm-store
jobs:
setup:
runs-on: ubuntu-latest
container: jimfx/nodes:latest
steps:
- name: 📑 Checkout Code
uses: actions/checkout@v4
- name: 💾 Setup pnpm Cache
uses: actions/cache@v4
with:
path: ${{ env.PNPM_CACHE_FOLDER }}
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: 📦 Install Dependencies
run: pnpm install --frozen-lockfile --store-dir ${{ env.PNPM_CACHE_FOLDER }}
- name: 📤 Upload Workspace
uses: actions/upload-artifact@v3
with:
name: workspace-deps
path: .
include-hidden-files: true
# Compression level 0 is recommended by docs for large non-compressible files
# but for code/node_modules, the default (6) is usually fine.
compression-level: 6
lint:
needs: setup
runs-on: ubuntu-latest
container: jimfx/nodes:latest
steps:
- name: 📥 Download Workspace
uses: actions/download-artifact@v3
with:
name: workspace-deps
path: .
- name: 🧹 Run Linter
run: pnpm lint
format:
needs: setup
runs-on: ubuntu-latest
container: jimfx/nodes:latest
steps:
- name: 📥 Download Workspace
uses: actions/download-artifact@v3
with:
name: workspace-deps
path: .
- name: 🎨 Check Formatting
run: pnpm format:check
typecheck:
needs: setup
runs-on: ubuntu-latest
container: jimfx/nodes:latest
steps:
- name: 📥 Download Workspace
uses: actions/download-artifact@v3
with:
name: workspace-deps
path: .
- name: 🧬 Type Check
run: pnpm check
build_and_deploy:
if: github.ref == 'refs/heads/main'
needs: [lint, format, typecheck]
runs-on: ubuntu-latest
container: jimfx/nodes:latest
steps:
- name: 📥 Download Workspace
uses: actions/download-artifact@v3
with:
name: workspace-deps
path: .
- name: 🛠️ Build Site
run: pnpm run build:deploy
- name: 🔑 Configure rclone
run: |
mkdir -p ~/.config/rclone
cat <<EOF > ~/.config/rclone/rclone.conf
[sftp-remote]
type = sftp
host = ${SSH_HOST}
user = ${SSH_USER}
port = ${SSH_PORT}
key_use_agent = false
key_data = ${SSH_PRIVATE_KEY}
EOF
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_HOST: ${{ vars.SSH_HOST }}
SSH_PORT: ${{ vars.SSH_PORT }}
SSH_USER: ${{ vars.SSH_USER }}
- name: 🚚 Deploy via rclone
run: |
rclone sync --update -v --progress --exclude "_astro/**" --stats 2s --stats-one-line ./app/build/ sftp-remote:${REMOTE_DIR} --transfers 4
env:
REMOTE_DIR: ${{ vars.REMOTE_DIR }}