Skip to content

Commit

Permalink
Add api release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
michalwarda committed Feb 19, 2024
1 parent 5ee8002 commit 9ad8534
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/api-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: API Release
on:
push:
tags:
- 'api-v*.*.*'
defaults:
run:
working-directory: apps/api

jobs:
test:
name: Test
runs-on: ubuntu-latest

services:
postgres:
image: ankane/pgvector:latest
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
env:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres

steps:
- uses: erlef/setup-beam@v1
with:
otp-version: '26'
elixir-version: '1.16.1'
- uses: actions/checkout@v4
- name: Cache deps
id: cache-deps
uses: actions/cache@v3
env:
cache-name: cache-elixir-deps
with:
path: apps/api/deps
key: ${{ runner.os }}-mix-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-${{ env.cache-name }}-
- name: Cache compiled build
id: cache-build
uses: actions/cache@v3
env:
cache-name: cache-compiled-build
with:
path: apps/api/_build
key: ${{ runner.os }}-mix-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-${{ env.cache-name }}-
${{ runner.os }}-mix-
- run: mix deps.get
- name: Compiles without warnings
run: mix compile
- run: mix test
env:
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.BUILDEL_API-FLY_API_TOKEN }}

0 comments on commit 9ad8534

Please sign in to comment.