Skip to content

Fix undo to restore clipped polygons via event sourcing #77

Fix undo to restore clipped polygons via event sourcing

Fix undo to restore clipped polygons via event sourcing #77

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
IMAGE: ghcr.io/${{ github.repository }}
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
with:
workspaces: backend
- name: cargo fmt
run: cargo fmt --check
working-directory: backend
- name: cargo clippy
run: cargo clippy --all-targets -- -D warnings
working-directory: backend
test-backend:
runs-on: ubuntu-latest
services:
db:
image: postgis/postgis:16-3.4
env:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: test
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U test"
--health-interval 5s
--health-timeout 5s
--health-retries 10
env:
TEST_DATABASE_URL: postgres://test:test@localhost:5432/test
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: backend
- name: cargo test
run: cargo test
working-directory: backend
test-frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: frontend/package-lock.json
- run: npm ci
working-directory: frontend
- run: npm run build
working-directory: frontend
publish:
needs: [lint, test-backend, test-frontend]
if: github.event_name == 'push'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v6
with:
context: .
file: backend/Dockerfile
push: true
cache-from: type=gha,scope=backend-image
cache-to: type=gha,mode=max,scope=backend-image
build-args: |
VITE_FATHOM_URL=${{ vars.VITE_FATHOM_URL }}
tags: |
${{ env.IMAGE }}:latest
${{ env.IMAGE }}:${{ github.sha }}
deploy:
needs: publish
runs-on: ubuntu-latest
if: vars.DEPLOY_HOST != ''
steps:
- name: Deploy via SSH
uses: appleboy/ssh-action@v1
with:
host: ${{ vars.DEPLOY_HOST }}
username: ${{ vars.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_SSH_KEY }}
script: |
cd ~/beebeebike
docker compose -f compose.prod.yml pull backend
docker compose -f compose.prod.yml up -d backend