Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/fly deploy #30

Merged
merged 9 commits into from
Dec 22, 2024
175 changes: 175 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
# flyctl launch added from .gitignore
# Created by https://www.toptal.com/developers/gitignore/api/flask,python,visualstudiocode
# Edit at https://www.toptal.com/developers/gitignore?templates=flask,python,visualstudiocode

### Deployment Providers ###
**/.vercel

### Flask ###
**/instance/*
!**/instance/.gitignore
**/.webassets-cache
**/.env

### Flask.Python Stack ###
# Byte-compiled / optimized / DLL files
**/__pycache__
**/*.py[cod]
**/*$py.class

# Distribution / packaging
**/.Python
**/build
**/develop-eggs
**/dist
**/downloads
**/eggs
**/.eggs
**/lib
**/lib64
**/parts
**/sdist
**/var
**/wheels
**/share/python-wheels
**/*.egg-info
**/.installed.cfg
**/*.egg
**/MANIFEST
**/*.lock
# allow poetry.lock
!**/poetry.lock

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
**/*.manifest
**/*.spec

# Installer logs
**/pip-log.txt
**/pip-delete-this-directory.txt

# Unit test / coverage reports
**/htmlcov
**/.tox
**/.nox
**/.coverage
**/.coverage.*
**/.cache
**/nosetests.xml
**/coverage.xml
**/*.cover
**/*.py,cover
**/.hypothesis
**/.pytest_cache
**/cover

# Translations
**/*.mo
**/*.pot

# Django stuff:
**/*.log
**/local_settings.py
**/db.sqlite3
**/db.sqlite3-journal

# Flask stuff:
**/instance

# Scrapy stuff:
**/.scrapy

# Sphinx documentation
**/docs/_build

# PyBuilder
**/.pybuilder
**/target

# Jupyter Notebook
**/.ipynb_checkpoints

# IPython
**/profile_default
**/ipython_config.py

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
**/__pypackages__

# Celery stuff
**/celerybeat-schedule
**/celerybeat.pid

# SageMath parsed files
**/*.sage.py

# Environments
**/.venv
**/.env
**/venv
**/.direnv
**/.envrc

# Spyder project settings
**/.spyderproject
**/.spyproject

# Rope project settings
**/.ropeproject

# mkdocs documentation
site

# mypy
**/.mypy_cache
**/.dmypy.json
**/dmypy.json

# Pyre type checker
**/.pyre

# pytype static type analyzer
**/.pytype

# Cython debug symbols
**/cython_debug

### VisualStudioCode ###
**/.vscode/*
!**/.vscode/settings.json
!**/.vscode/tasks.json
!**/.vscode/launch.json
!**/.vscode/extensions.json
!**/.vscode/*.code-snippets

# Local History for Visual Studio Code
**/.history

# Built Visual Studio Code Extensions
**/*.vsix

### VisualStudioCode Patch ###
# Ignore all local history of files
**/.history
**/.ionide

# Support for Project snippet scope
**/.vscode/*.code-snippets

# Ignore code-workspaces
**/*.code-workspace

# Snyk vuln scanner
**/.dccache

# Config file
**/config.ini

# End of https://www.toptal.com/developers/gitignore/api/flask,python,visualstudiocode

# flyctl launch added from .mypy_cache/.gitignore
# Automatically created by mypy
.mypy_cache/**/*
fly.toml
18 changes: 18 additions & 0 deletions .github/workflows/fly-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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
concurrency: deploy-group # optional: ensure only one action runs at a time
steps:
- uses: actions/checkout@v4
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
Comment on lines +10 to +18

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions Job or Workflow does not set permissions
20 changes: 20 additions & 0 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# fly.toml app configuration file generated for bm-monitor on 2024-12-21T13:42:03-06:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = 'bm-monitor'
primary_region = 'dfw'

[build]

[http_service]
internal_port = 8080
force_https = true
auto_stop_machines = 'stop'
auto_start_machines = true
min_machines_running = 0
processes = ['app']

[[vm]]
size = 'shared-cpu-1x'
Loading