Skip to content

Commit 33c873e

Browse files
committed
Merge branch 'main' into production
2 parents 6be0017 + dc86d81 commit 33c873e

8 files changed

Lines changed: 47 additions & 81 deletions

File tree

‎.dockerignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.*

‎.env.example‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
SLACK_SIGNING_SECRET=
2+
SLACK_BOT_TOKEN=
3+
4+
BOT_LOGS_CHANNEL=
5+
GT_BITS_CHANNEL=
6+
MAPSCOUT_NOTIFICATIONS_CHANNEL=
7+
8+
MONGO_DB_URL=
9+
MONGO_DB_DATABASE=

‎.github/workflows/main.yml‎

Lines changed: 17 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,28 @@
1-
name: deploy website
2-
# On pull request, make a deployment to Preview
3-
# On merge into main, make a deployment to Develop
4-
# On merge into prod, flag prod, make a deployment to Production
1+
name: deploy bit-bot
2+
53
on:
64
push:
7-
branches: [main, production]
8-
pull_request:
9-
branches: [main]
5+
branches: [production]
106
jobs:
117
deploy:
128
runs-on: ubuntu-latest
139
steps:
14-
- uses: actions/checkout@v2
15-
- name: Set pipeline
16-
id: pipeline
17-
# if its a PR, then its for preview, else its for development or prod based on what it's being pushed to.
18-
run: echo ::set-output name=pipeline::${{ github.event_name == 'pull_request' && 'Preview' || (github.ref == 'refs/heads/production' && 'Production' || 'Development') }}
19-
20-
- uses: chrnorm/deployment-action@releases/v1
21-
name: Create GitHub deployment
22-
id: deployment
23-
with:
24-
token: "${{ github.token }}"
25-
environment: ${{ steps.pipeline.outputs.pipeline }}
26-
target_url: ""
10+
- uses: actions/checkout@v4
2711

28-
- uses: amondnet/vercel-action@v19
29-
name: Deploy to Vercel
30-
id: vercel_deploy
12+
-
13+
name: Login to Docker Hub
14+
uses: docker/login-action@v3
3115
with:
32-
vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required
33-
github-token: ${{ secrets.GITHUB_TOKEN }} #Optional
34-
vercel-args: ${{ steps.pipeline.outputs.pipeline == 'Production' && '--prod' || null}} #Optional
35-
vercel-org-id: ${{ secrets.ORG_ID}} #Required
36-
vercel-project-id: ${{ secrets.PROJECT_ID}} #Required
37-
#working-directory: ./sub-directory #Your Working Directory, Optional
38-
# alias-domains: | #Optional, for when an actual domain is provided
39-
# staging.angular.vercel-action.amond.dev
40-
# pr-{{PR_NUMBER}}.angular.vercel-action.amond.dev
16+
username: ${{ vars.DOCKERHUB_USERNAME }}
17+
password: ${{ secrets.DOCKERHUB_TOKEN }}
4118

42-
- name: Update deployment status (success)
43-
if: success()
44-
uses: chrnorm/deployment-status@releases/v1
45-
with:
46-
token: ${{ secrets.GITHUB_TOKEN }}
47-
target_url: ${{ steps.vercel_deploy.outputs.preview-url }}
48-
environment_url: ${{ steps.vercel_deploy.outputs.preview-url }}
49-
state: "success"
50-
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
19+
-
20+
name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v3
5122

52-
- name: Update deployment status (failure)
53-
if: failure()
54-
uses: chrnorm/deployment-status@releases/v1
23+
-
24+
name: Build and push
25+
uses: docker/build-push-action@v6
5526
with:
56-
token: ${{ secrets.GITHUB_TOKEN }}
57-
target_url: ${{ steps.vercel_deploy.outputs.preview-url }}
58-
environment_url: ${{ steps.vercel_deploy.outputs.preview-url }}
59-
state: "failure"
60-
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
27+
push: true
28+
tags: bitsofgood/bit-bot:latest

‎Dockerfile‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM python:3.11-slim
2+
3+
WORKDIR /app
4+
COPY requirements.txt .
5+
RUN pip install -r requirements.txt gunicorn
6+
COPY . .
7+
CMD ["gunicorn", "--workers", "3", "--bind", "0.0.0.0:8080", "app:app"]

‎README.md‎

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,19 @@
1-
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Fexamples%2Ftree%2Fmain%2Fpython%2Fflask&demo-title=Flask%20%2B%20Vercel&demo-description=Use%20Flask%202%20on%20Vercel%20with%20Serverless%20Functions%20using%20the%20Python%20Runtime.&demo-url=https%3A%2F%2Fflask-python-template.vercel.app%2F&demo-image=https://assets.vercel.com/image/upload/v1669994156/random/flask.png)
1+
# Bit Bot
22

3-
# Flask + Vercel
3+
## Getting Started
44

5-
This example shows how to use Flask 2 on Vercel with Serverless Functions using the [Python Runtime](https://vercel.com/docs/concepts/functions/serverless-functions/runtimes/python).
6-
7-
## Demo
8-
9-
https://flask-python-template.vercel.app/
10-
11-
## How it Works
12-
13-
This example uses the Web Server Gateway Interface (WSGI) with Flask to enable handling requests on Vercel with Serverless Functions.
14-
15-
## Running Locally
5+
### Prerequisites:
6+
- Python
167

8+
1. Create and activate a [Python virtual environment](https://docs.python.org/3/library/venv.html)
9+
2. Install dependencies:
1710
```bash
18-
npm i -g vercel
19-
vercel dev
11+
pip install -r requirements.txt
12+
```
13+
3. Create a file `.env` and paste the secrets from the Exec Bitwarden
14+
4. Run the bot:
15+
```bash
16+
flask run -p 8080
2017
```
2118

22-
Your Flask application is now available at `http://localhost:3000`.
23-
24-
## One-Click Deploy
25-
26-
Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=vercel-examples):
27-
28-
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Fexamples%2Ftree%2Fmain%2Fpython%2Fflask&demo-title=Flask%20%2B%20Vercel&demo-description=Use%20Flask%202%20on%20Vercel%20with%20Serverless%20Functions%20using%20the%20Python%20Runtime.&demo-url=https%3A%2F%2Fflask-python-template.vercel.app%2F&demo-image=https://assets.vercel.com/image/upload/v1669994156/random/flask.png)
19+
## Deployment

‎api/.env.example‎

Lines changed: 0 additions & 5 deletions
This file was deleted.
File renamed without changes.

‎vercel.json‎

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)