From 0133999bbd56e705d1c0a99c5f8e8177ff05fc51 Mon Sep 17 00:00:00 2001 From: bkellam Date: Fri, 6 Sep 2024 11:27:20 -0700 Subject: [PATCH] Add fly.io config & workflow --- .github/workflows/fly-deploy.yml | 27 +++++++++++++++++++++++++++ Dockerfile | 2 ++ fly.toml | 26 ++++++++++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 .github/workflows/fly-deploy.yml create mode 100644 fly.toml diff --git a/.github/workflows/fly-deploy.yml b/.github/workflows/fly-deploy.yml new file mode 100644 index 00000000..4bc68dba --- /dev/null +++ b/.github/workflows/fly-deploy.yml @@ -0,0 +1,27 @@ +# See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/ + +name: Fly Deploy +on: + push: + branches: + - main + +jobs: + deploy: + name: Deploy app + runs-on: ubuntu-latest + environment: production + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: 'true' + + - name: Use flyctl + uses: superfly/flyctl-actions/setup-flyctl@master + + - name: Deploy to fly.io + run: flyctl deploy --local-only + env: + FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} diff --git a/Dockerfile b/Dockerfile index e0c14b69..976e6b92 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,6 +15,8 @@ FROM node-alpine AS web-builder RUN apk add --no-cache libc6-compat WORKDIR /app COPY package.json yarn.lock* ./ + +# Fixes arm64 timeouts RUN yarn config set registry https://registry.npmjs.org/ RUN yarn config set network-timeout 1200000 RUN yarn --frozen-lockfile diff --git a/fly.toml b/fly.toml new file mode 100644 index 00000000..88101445 --- /dev/null +++ b/fly.toml @@ -0,0 +1,26 @@ +# fly.toml app configuration file generated for sourcebot on 2024-09-06T11:03:58-07:00 +# +# See https://fly.io/docs/reference/configuration/ for information about how to use this file. +# + +app = 'sourcebot' +primary_region = 'sjc' + +[build] + +[http_service] + internal_port = 3000 + force_https = true + auto_stop_machines = 'stop' + auto_start_machines = true + min_machines_running = 0 + processes = ['app'] + +[[vm]] + memory = '1gb' + cpu_kind = 'shared' + cpus = 1 + +[mounts] + source = "sourcebot_data" + destination = "/data"