Skip to content
This repository was archived by the owner on Feb 8, 2025. It is now read-only.

Fix api release #189

Merged
merged 5 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ jobs:
uses: superfly/flyctl-actions/setup-flyctl@master

- name: 🚀 Deploy
run: flyctl deploy . --config api/fly.toml --remote-only --wait-timeout 120
run: >
flyctl deploy . --config api/fly.toml
--remote-only
--wait-timeout 180
--build-arg TURBO_TOKEN=$TURBO_TOKEN
--build-arg TURBO_TEAM=$TURBO_TEAM
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

Expand Down
18 changes: 15 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,24 @@ jobs:
- name: 📦 Install
run: yarn

- name: 🏗️ Build
run: yarn api build

- name: 🧪 Test
run: yarn api test

api-build:
runs-on: ubuntu-latest

steps:
- name: 🚧 Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: 🏗️ Build
run: >
docker build -f ./api/Dockerfile .
--build-arg TURBO_TOKEN=$TURBO_TOKEN
--build-arg TURBO_TEAM=$TURBO_TEAM

api-ampli:
runs-on: ubuntu-latest
container:
Expand Down
7 changes: 6 additions & 1 deletion api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

FROM node:20-alpine as builder

ARG TURBO_TEAM
ENV TURBO_TEAM=$TURBO_TEAM
ARG TURBO_TOKEN
ENV TURBO_TOKEN=$TURBO_TOKEN

ENV NODE_ENV build

USER node
Expand All @@ -18,7 +23,7 @@ RUN yarn api build
## Runtime
## ------------------------------

FROM node:20-alpine
FROM node:20-alpine as runtime

ENV NODE_ENV production

Expand Down
2 changes: 1 addition & 1 deletion api/fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ swap_size_mb = 512
dockerfile = "Dockerfile"

[deploy]
release_command = "cd api && yarn db:migrate && yarn db:seed"
release_command = "yarn api db:prepare"

[env]
API_PORT = 3000
Expand Down
1 change: 1 addition & 0 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"generate:schema": "yarn prebuild && SKIP_ENV_CHECK=true nest start --entryFile generate-schema",
"generate:edgeql": "npx -y concurrently -n edgeql-js,interfaces -c blue,magenta \"npx @edgedb/generate edgeql-js --target ts --force-overwrite\" \"npx @edgedb/generate interfaces\"",
"generate:gql": "graphql-codegen --config codegen.ts",
"db:prepare": "yarn db:migrate && yarn db:seed",
"db:seed": "tsx ./dbschema/seed.ts",
"db:migrate": "yarn with-env -- edgedb migrate"
},
Expand Down
4 changes: 4 additions & 0 deletions api/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
"test": {
"dependsOn": ["prepare"],
"inputs": ["dbschema/**", "src/**", "jest.config.ts"]
},
"db:prepare": {
"dependsOn": ["prepare"],
"inputs": ["dbschema/**", "src/**", "jest.config.ts"]
}
}
}
1 change: 1 addition & 0 deletions turbo.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"$schema": "https://turbo.build/schema.json",
"globalEnv": ["DOTENV_KEY", "NODE_ENV"],
"globalDotEnv": [".env"],
"globalDependencies": [".env.vault", "tsconfig.base.json"],
"pipeline": {
Expand Down
Loading