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"