ci: refactor workflows
This commit is contained in:
parent
024e96df55
commit
070a70c0b8
14
.gitea/workflows/branches.yaml
Normal file
14
.gitea/workflows/branches.yaml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
name: Build and Push Docker Image
|
||||||
|
run-name: ${{ gitea.actor }}
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "!main"
|
||||||
|
- "**/*"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
tests:
|
||||||
|
uses: ./.gitea/workflows/test.yaml
|
||||||
|
build:
|
||||||
|
needs: [tests]
|
||||||
|
runs-on: ubuntu-latest
|
@ -6,25 +6,11 @@ on:
|
|||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
tests:
|
||||||
|
uses: ./.gitea/workflows/test.yaml
|
||||||
build:
|
build:
|
||||||
|
needs: [tests]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
services:
|
|
||||||
postgres:
|
|
||||||
image: postgres:17-alpine
|
|
||||||
|
|
||||||
env:
|
|
||||||
POSTGRES_PASSWORD: postgres
|
|
||||||
POSTGRES_USER: postgres
|
|
||||||
POSTGRES_DB: postgres
|
|
||||||
|
|
||||||
options: >-
|
|
||||||
--health-cmd pg_isready
|
|
||||||
--health-interval 10s
|
|
||||||
--health-timeout 5s
|
|
||||||
--health-retries 5
|
|
||||||
ports:
|
|
||||||
- 5432:5432
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@ -39,16 +25,6 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: bun install
|
run: bun install
|
||||||
|
|
||||||
- name: Push Database - Test
|
|
||||||
run: bun run db:push
|
|
||||||
env:
|
|
||||||
POSTGRES_URL: postgres://postgres:postgres@postgres:5432/postgres
|
|
||||||
|
|
||||||
- name: Test API
|
|
||||||
run: bun test:api
|
|
||||||
env:
|
|
||||||
POSTGRES_URL: postgres://postgres:postgres@postgres:5432/postgres
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: bun run build
|
run: bun run build
|
||||||
env:
|
env:
|
@ -1,10 +1,6 @@
|
|||||||
name: Test
|
name: Test
|
||||||
run-name: ${{ gitea.actor }}
|
run-name: ${{ gitea.actor }}
|
||||||
on:
|
on: [workflow_call]
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- '**/*'
|
|
||||||
- '!main'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
Loading…
Reference in New Issue
Block a user