Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@ name: Deploy Python Application
on:
push:
branches:
- main
- master
- dev

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.x'

Expand All @@ -24,8 +25,7 @@ jobs:
pip install -r requirement-test.txt

- name: Run tests
run: |
pytest main_test.py
run: pytest

# - name: Deploy to Cloud Functions
# run: |
Expand Down
17 changes: 15 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Release Process
on:
pull_request:
branches: [master]
types: [closed]
push:
branches: [master]
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -33,7 +36,6 @@ jobs:
REPO_NAME: ${{ env.REPO_NAME }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
module_name: 'poc_module'

- name: Tag generated
run: echo "RELEASE_TAG=${{ steps.semantic_release.outputs.release_version }}" >> $GITHUB_ENV
Expand All @@ -47,10 +49,21 @@ jobs:
## IMPORTANT: this permission is mandatory for Trusted Publishing
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install build and twine
run: python -m pip install --upgrade pip build twine bump2version wheel

- name: Publish
run: |
python -m build
twine upload dist/* --repository-url https://upload.pypi.org/legacy/ --verbose
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{secrets.PYPI_TOKEN}}
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
7 changes: 5 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
__version__ = "0.1.0"

from flask import Flask, request, jsonify
from google.cloud import storage
import os

app = Flask(__name__)

@app.route('/')
def index():
"""Return a friendly HTTP greeting."""
return "Hello, World!"
return "Hello, World!"

if __name__ == '__main__':
app.run(debug=True, host="0.0.0.0", port=8080)
6 changes: 4 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Flask==2.0.3
Flask==3.0.3
google-cloud-functions==1.0.0
request==2.26.0
requests==2.26.0
Werkzeug==3.0.3
gunicorn==23.0.0
Loading