Files

85 lines
2.4 KiB
YAML

name: Staging
on:
push:
branches: [staging]
permissions:
contents: read
jobs:
changes:
runs-on: ubuntu-latest
outputs:
desktop: ${{ steps.filter.outputs.desktop }}
server: ${{ steps.filter.outputs.server }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
base: ${{ github.ref }}
filters: |
desktop:
- 'src/**'
- 'src-tauri/**'
- 'messages/**'
- 'project.inlang/**'
- 'scripts/check-i18n.mjs'
- 'package.json'
- 'bun.lock'
- 'svelte.config.js'
- 'tsconfig.json'
- 'vite.config.js'
- 'Cargo.toml'
- 'Cargo.lock'
- 'src-common/**'
- '.gitattributes'
- '.github/workflows/**'
server:
- 'src-server/**'
- 'Dockerfile'
- 'Cargo.toml'
- 'Cargo.lock'
- 'src-common/**'
- '.github/workflows/**'
desktop:
needs: changes
if: needs.changes.outputs.desktop == 'true'
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- uses: dtolnay/rust-toolchain@stable
- name: Cache Bun packages
uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-${{ runner.arch }}-bun-${{ hashFiles('bun.lock') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-bun-
- uses: Swatinem/rust-cache@v2.9.2
- run: bun install --frozen-lockfile
- run: bun run check
- run: cargo check --locked --package Friendolls
server:
needs: changes
if: needs.changes.outputs.server == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2.9.2
- run: cargo test --locked --package friendolls-server
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Ensure the production image builds
uses: docker/build-push-action@v6
with:
context: .
push: false
cache-from: type=gha,scope=server
cache-to: type=gha,mode=max,scope=server