79 lines
2.0 KiB
YAML
79 lines
2.0 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: Write Git-Hash into html
|
|
run: ./pipeline/create-git-hash-html.sh
|
|
- name: Create Build Artifact
|
|
uses: christopherhx/gitea-upload-artifact@v4
|
|
with:
|
|
name: dist
|
|
path: dist
|
|
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
container:
|
|
image: oven/bun
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Setup Biome
|
|
uses: biomejs/setup-biome@v2
|
|
with:
|
|
version: latest
|
|
token: ${{ secrets.BIOME_TOKEN }}
|
|
- name: Run Biome
|
|
run: biome ci .
|
|
|
|
create-and-publish-docker-image:
|
|
needs: [lint]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: christopherhx/gitea-download-artifact@v4
|
|
with:
|
|
name: dist
|
|
path: dist
|
|
- 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
|
|
git clean -dfx
|
|
git reset --hard HEAD
|
|
git pull
|
|
docker-compose pull
|
|
docker-compose down
|
|
docker-compose up -d
|
|
|