73 lines
1.9 KiB
YAML
73 lines
1.9 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: oven/bun
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install dependencies
|
|
run: bun install
|
|
- name: Build
|
|
run: bun run build
|
|
- name: Create Build Artifact
|
|
uses: christopherhx/gitea-upload-artifact@v4
|
|
with:
|
|
name: build
|
|
path: dist
|
|
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
container:
|
|
image: oven/bun
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install Biome
|
|
run: bun install -g biome
|
|
- name: Run Biome lint
|
|
run: biome lint .
|
|
- name: Run Biome format check
|
|
run: biome format .
|
|
|
|
build-and-push-docker:
|
|
needs: [build]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: christopherhx/gitea-download-artifact@v4
|
|
with:
|
|
name: build
|
|
- name: Log in to Docker Registry
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: git.rivercry.com
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
- name: Build Docker image
|
|
run: docker build -t git.rivercry.com/wg/monitor-im-flur .
|
|
- name: Push Docker image
|
|
run: docker push git.rivercry.com/wg/monitor-im-flur
|
|
|
|
- name: Deploy via SSH
|
|
uses: appleboy/ssh-action@v0.1.10
|
|
with:
|
|
host: rivercry.com
|
|
port: 20022
|
|
username: docker
|
|
password: ${{ secrets.GARRISON_DOCKER_PASSWORD }}
|
|
script: |
|
|
cd monitor-im-flur
|
|
echo "Deploying Docker container..."
|
|
docker-compose pull
|
|
docker-compose stop || true
|
|
docker-compose rm || true
|
|
docker-compose up -d |