boring.tools-poc/.gitea/workflows/build_and_push.yaml
Lars Hampe 7285fd945a
Some checks failed
Test / build (push) Failing after 33s
ci: check other env vars on testing
2024-10-01 18:35:35 +02:00

75 lines
1.7 KiB
YAML

name: Build and Push Docker Image
run-name: ${{ gitea.actor }}
on:
push:
branches:
- main
jobs:
build:
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:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.1.29
- name: Install dependencies
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
run: bun run build
env:
NODE_ENV: production
VITE_CLERK_PUBLISHABLE_KEY: ${{ vars.CLERK_KEY }}
- name: Set docker chmod (temp solution)
run: sudo chmod 666 /var/run/docker.sock
- name: Docker - Login
uses: docker/login-action@v1
with:
registry: git.hashdot.co
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and Push Website
run: bun docker:website
- name: Build and Push API
run: bun docker:api
- name: Build and Push App
run: bun docker:app