From ec1e29161979a29ad88cc57bd923f4d8157ec8f5 Mon Sep 17 00:00:00 2001 From: "Sakamoto, Kazunori" Date: Wed, 18 Sep 2024 19:11:10 +0900 Subject: [PATCH] chore: add deploy settings for production --- .github/workflows/deploy-production.yml | 19 +++++++++++++++++++ .github/workflows/release.yml | 15 +++++++++++++++ fly-production.toml | 19 +++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 .github/workflows/deploy-production.yml create mode 100644 .github/workflows/release.yml create mode 100644 fly-production.toml diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml new file mode 100644 index 00000000..04af65b0 --- /dev/null +++ b/.github/workflows/deploy-production.yml @@ -0,0 +1,19 @@ +name: Deploy production +on: + workflow_dispatch: + release: + types: + - published +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: false +jobs: + deploy: + uses: exKAZUu-Research/reusable-workflows/.github/workflows/deploy.yml@main + with: + environment: production + secrets: + DOT_ENV: ${{ secrets.DOT_ENV_PRODUCTION }} + FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} + GCP_SA_KEY_JSON: ${{ secrets.GCP_SA_KEY }} + GH_TOKEN: ${{ secrets.GH_BOT_PAT }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..ded1fa3d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,15 @@ +name: Release +on: + push: + branches: + - release +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: false +jobs: + release: + uses: exKAZUu-Research/reusable-workflows/.github/workflows/release.yml@main + with: + skip_build: true + secrets: + GH_TOKEN: ${{ secrets.GH_BOT_PAT }} diff --git a/fly-production.toml b/fly-production.toml new file mode 100644 index 00000000..c0772119 --- /dev/null +++ b/fly-production.toml @@ -0,0 +1,19 @@ +app = 'trace-dojo' +primary_region = 'nrt' + +[[mounts]] + source = "db" + destination = "/app/prisma/mount" + +[http_service] + internal_port = 8080 + force_https = true + auto_stop_machines = true + auto_start_machines = true + min_machines_running = 0 + processes = ['app'] + +[[vm]] + memory = '512mb' + cpu_kind = 'shared' + cpus = 1