From 447918a3a424dc7b1460a722eb308d50e5bf51bd Mon Sep 17 00:00:00 2001 From: Dale Seo Date: Sat, 3 May 2025 22:46:33 -0400 Subject: [PATCH] feat: add Fly Deploy and Fly Review workflows --- .github/workflows/fly-deploy.yml | 21 +++++++++++++++++++++ .github/workflows/fly-review.yml | 25 +++++++++++++++++++++++++ Dockerfile | 2 ++ fly.toml | 22 ++++++++++++++++++++++ 4 files changed, 70 insertions(+) create mode 100644 .github/workflows/fly-deploy.yml create mode 100644 .github/workflows/fly-review.yml create mode 100644 Dockerfile create mode 100644 fly.toml diff --git a/.github/workflows/fly-deploy.yml b/.github/workflows/fly-deploy.yml new file mode 100644 index 0000000..da6aeaa --- /dev/null +++ b/.github/workflows/fly-deploy.yml @@ -0,0 +1,21 @@ +name: Fly Deploy +on: + push: + branches: + - main +jobs: + deploy: + runs-on: ubuntu-latest + environment: production + concurrency: deploy-group + steps: + - uses: actions/checkout@v4 + - uses: superfly/flyctl-actions/setup-flyctl@master + - run: | + flyctl secrets set \ + APOLLO_GRAPH_REF=${{ secrets.APOLLO_GRAPH_REF }} \ + APOLLO_KEY=${{ secrets.APOLLO_KEY }} \ + GITHUB_API_TOKEN=${{ secrets.GH_API_TOKEN }} + flyctl deploy --remote-only + env: + FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} diff --git a/.github/workflows/fly-review.yml b/.github/workflows/fly-review.yml new file mode 100644 index 0000000..d100c24 --- /dev/null +++ b/.github/workflows/fly-review.yml @@ -0,0 +1,25 @@ +name: Fly Review +on: + pull_request: + types: [opened, reopened, synchronize, closed] +env: + FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} +jobs: + review: + runs-on: ubuntu-latest + concurrency: + group: pr-${{ github.event.number }} + environment: + name: staging + url: ${{ steps.deploy.outputs.url }} + steps: + - uses: actions/checkout@v4 + - uses: superfly/fly-pr-review-apps@1.5.0 + id: deploy + with: + region: yyz + name: ${{ github.event.repository.name }}-pr-${{ github.event.number }} + secrets: | + APOLLO_GRAPH_REF=${{ secrets.APOLLO_GRAPH_REF }} + APOLLO_KEY=${{ secrets.APOLLO_KEY }} + GITHUB_API_TOKEN=${{ secrets.GH_API_TOKEN }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0ec489e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,2 @@ +FROM ghcr.io/apollographql/router:v2.1.1 +COPY router.yaml /dist/config/router.yaml \ No newline at end of file diff --git a/fly.toml b/fly.toml new file mode 100644 index 0000000..88ecd64 --- /dev/null +++ b/fly.toml @@ -0,0 +1,22 @@ +# fly.toml app configuration file generated for dalestudy on 2025-05-03T20:01:41-04:00 +# +# See https://fly.io/docs/reference/configuration/ for information about how to use this file. +# + +app = 'dalestudy' +primary_region = 'yyz' + +[build] + +[http_service] + internal_port = 8080 + 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