-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (46 loc) · 1.46 KB
/
build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: 🏗️ Build Engine
on:
push:
paths:
- 'engine/**'
- '.github/workflows/build.yaml'
jobs:
deploy:
runs-on: ubuntu-20.04
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
with:
version: "v0.7.4"
- name: Start postgres via docker-compose dev
working-directory: ./engine
run: docker compose -f ./compose.yaml up postgres -d
- name: Setup Env
working-directory: ./engine
run: cp .env.example .env
- name: Get Runner IP
id: get_ip
run: echo "RUNNER_IP=$(hostname -I | awk '{print $1}')" >> $GITHUB_ENV
- name: Migrate db
working-directory: ./engine
run: cargo install sqlx-cli --no-default-features --features native-tls,postgres && sqlx migrate run
- name: Build
working-directory: ./engine
run: sqlx migrate run
- name: Build docker image using github actions
uses: docker/build-push-action@v5
with:
context: ./engine
file: ./engine/.build/Dockerfile
tags: v3x-property-engine:latest
push: false
build-args: |
BINARY_NAME=v3x-property-engine
DATABASE_URL=postgres://postgres:postgres@${{ env.RUNNER_IP }}:5432/postgres