diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml new file mode 100644 index 0000000..44ee672 --- /dev/null +++ b/.github/workflows/build-docker.yml @@ -0,0 +1,31 @@ +name: Create and deploy Docker image + +on: [push, pull_request] + +jobs: + build-develop-docker-image: + runs-on: ubuntu-latest + # Run only on develop branch + if: github.ref == 'refs/heads/develop' + steps: + - uses: actions/checkout@v3 + - name: Build and publish develop Docker image + uses: elgohr/Publish-Docker-Github-Action@v5 + with: + name: hsldevcom/transitdata-monitor-data-collector + username: ${{ secrets.TRANSITDATA_DOCKERHUB_USER }} + password: ${{ secrets.TRANSITDATA_DOCKERHUB_TOKEN }} + tags: develop + build-release-docker-image: + runs-on: ubuntu-latest + # Run only for tagged commits + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + steps: + - uses: actions/checkout@v3 + - name: Build and publish release Docker image + uses: elgohr/Publish-Docker-Github-Action@v5 + with: + name: hsldevcom/transitdata-monitor-data-collector + username: ${{ secrets.TRANSITDATA_DOCKERHUB_USER }} + password: ${{ secrets.TRANSITDATA_DOCKERHUB_TOKEN }} + tag_semver: true \ No newline at end of file diff --git a/.gitignore b/.gitignore index 2b664c8..30825aa 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ access_token.txt .idea __pycache__ +venv +.DS_Store diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..06e9c14 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM python:3 + +COPY *.py requirements.txt /app/ +WORKDIR /app + +RUN ["pip3", "install", "-r", "requirements.txt"] \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 3a57e83..cac0150 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,5 @@ paho-mqtt==1.6.1 python-dotenv==0.20.0 gtfs-realtime-bindings==0.0.7 +protobuf<=3.20.1 +requests \ No newline at end of file