116 lines
3.0 KiB
YAML
116 lines
3.0 KiB
YAML
name: 🚀 Lint & Test & Deploy
|
|
|
|
on:
|
|
push:
|
|
branches: ["*"]
|
|
tags: ["*"]
|
|
pull_request:
|
|
branches: ["*"]
|
|
|
|
env:
|
|
PNPM_CACHE_FOLDER: .pnpm-store
|
|
CARGO_HOME: .cargo
|
|
CARGO_TARGET_DIR: target
|
|
|
|
jobs:
|
|
quality:
|
|
runs-on: ubuntu-latest
|
|
container: git.max-richter.dev/max/nodarium-ci:a56e8f445edb6064ae7a7b3b783fb7445f1b4e69
|
|
|
|
steps:
|
|
- name: 📑 Checkout Code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
token: ${{ secrets.GITEA_TOKEN }}
|
|
|
|
- name: 🔧 Setup
|
|
uses: ./.gitea/actions/setup
|
|
|
|
- name: 🧹 Quality Control
|
|
run: |
|
|
pnpm lint
|
|
pnpm format:check
|
|
pnpm check
|
|
pnpm build
|
|
|
|
test-unit:
|
|
runs-on: ubuntu-latest
|
|
container: git.max-richter.dev/max/nodarium-ci:a56e8f445edb6064ae7a7b3b783fb7445f1b4e69
|
|
|
|
steps:
|
|
- name: 📑 Checkout Code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
token: ${{ secrets.GITEA_TOKEN }}
|
|
|
|
- name: 🔧 Setup
|
|
uses: ./.gitea/actions/setup
|
|
|
|
- name: 🧪 Run Tests
|
|
run: xvfb-run --auto-servernum --server-args="-screen 0 1280x1024x24" pnpm test:unit
|
|
|
|
test-e2e:
|
|
runs-on: ubuntu-latest
|
|
container: git.max-richter.dev/max/nodarium-ci:a56e8f445edb6064ae7a7b3b783fb7445f1b4e69
|
|
|
|
steps:
|
|
- name: 📑 Checkout Code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
token: ${{ secrets.GITEA_TOKEN }}
|
|
|
|
- name: 🔧 Setup
|
|
uses: ./.gitea/actions/setup
|
|
|
|
- name: 🧪 Run Tests
|
|
run: xvfb-run --auto-servernum --server-args="-screen 0 1280x1024x24" pnpm test:e2e
|
|
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
needs: [quality, test-e2e, test-unit]
|
|
container: git.max-richter.dev/max/nodarium-ci:a56e8f445edb6064ae7a7b3b783fb7445f1b4e69
|
|
|
|
steps:
|
|
- name: 📑 Checkout Code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
token: ${{ secrets.GITEA_TOKEN }}
|
|
|
|
- name: 🔧 Setup
|
|
uses: ./.gitea/actions/setup
|
|
|
|
- name: 🏗️ Build Web Assets
|
|
run: pnpm build
|
|
|
|
- name: 🚀 Create Release Commit
|
|
if: gitea.ref_type == 'tag'
|
|
run: ./.gitea/scripts/create-release.sh
|
|
env:
|
|
BOT_PGP_PRIVATE_KEY: ${{ secrets.BOT_PGP_PRIVATE_KEY }}
|
|
|
|
- name: 🛠️ Build
|
|
run: ./.gitea/scripts/build.sh
|
|
|
|
- name: 🏷️ Create Gitea Release
|
|
if: gitea.ref_type == 'tag'
|
|
uses: akkuman/gitea-release-action@v1
|
|
with:
|
|
tag_name: ${{ gitea.ref_name }}
|
|
release_name: Release ${{ gitea.ref_name }}
|
|
body_path: CHANGELOG.md
|
|
draft: false
|
|
prerelease: false
|
|
|
|
- name: 🚀 Deploy Changed Files via rclone
|
|
run: ./.gitea/scripts/deploy-files.sh
|
|
env:
|
|
REMOTE_DIR: ${{ vars.REMOTE_DIR }}
|
|
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
SSH_HOST: ${{ vars.SSH_HOST }}
|
|
SSH_PORT: ${{ vars.SSH_PORT }}
|
|
SSH_USER: ${{ vars.SSH_USER }}
|