diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..bdcb8d7 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,19 @@ +name: Python application + +on: + push: + branches: [ python-ci-workflow-1 ] + pull_request: + branches: [ python-ci-workflow-1 ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.8" + - name: Display Python version + run: python -c "import sys; print(sys.version)" diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..81eb9ef --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +# syntax=docker/dockerfile:1 + +FROM python:3.8-slim-buster + +WORKDIR /app + +COPY requirements.txt requirements.txt +RUN pip3 install -r requirements.txt + +COPY . . + +CMD [ "python3", "-m" , "flask", "run", "--host=0.0.0.0"] diff --git a/app.py b/app.py new file mode 100644 index 0000000..32736b7 --- /dev/null +++ b/app.py @@ -0,0 +1,6 @@ +from flask import Flask +app = Flask(__name__) + +@app.route('/') +def hello_world(): + return 'Hello, GitHub Action!' diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..7e10602 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +flask