Skip to content

Commit

Permalink
feat: add image for strava uploader
Browse files Browse the repository at this point in the history
  • Loading branch information
bobdoah committed Apr 30, 2024
1 parent e364b9d commit 80c002d
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 4 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/containers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: containers
on:
push:
branches: main
jobs:
changes:
runs-on: ubuntu-latest
outputs:
strava: ${{ steps.filter.outputs.strava }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
strava:
- 'strava/**'
strava:
needs: changes
if: ${{ needs.changes.outputs.strava == 'true' }}
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate Tag
shell: bash
run: echo "tag=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}-${GITHUB_SHA:0:7}-$(date +%s)" >> $GITHUB_OUTPUT
id: generate_tag
-
name: Build and push
uses: docker/build-push-action@v4
with:
context: strava/
platforms: linux/amd64
push: true
tags: |
ghcr.io/bobdoah/strava-uploader:${{ steps.generate_tag.outputs.tag }}
13 changes: 13 additions & 0 deletions strava/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM python:3.12-slim

WORKDIR /usr/src/app

RUN pip install uv

COPY requirements.txt .

RUN uv venv && uv pip sync requirements.txt

COPY uploader.py strava_client.py .

ENTRYPOINT ["/usr/src/app/.venv/bin/python", "/usr/src/app/uploader.py"]
1 change: 1 addition & 0 deletions strava/requirements.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
stravalib
tomli-w
beautifulsoup4
11 changes: 7 additions & 4 deletions strava/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
# uv pip compile requirements.in
arrow==1.3.0
# via stravalib
beautifulsoup4==4.12.3
certifi==2024.2.2
# via requests
charset-normalizer==3.3.2
# via requests
idna==3.6
idna==3.7
# via requests
pint==0.23
# via stravalib
pydantic==1.10.9
pydantic==1.10.15
# via stravalib
python-dateutil==2.9.0.post0
# via arrow
Expand All @@ -20,11 +21,13 @@ requests==2.31.0
# via stravalib
six==1.16.0
# via python-dateutil
stravalib==1.6
soupsieve==2.5
# via beautifulsoup4
stravalib==1.7
tomli-w==1.0.0
types-python-dateutil==2.9.0.20240316
# via arrow
typing-extensions==4.10.0
typing-extensions==4.11.0
# via
# pint
# pydantic
Expand Down

0 comments on commit 80c002d

Please sign in to comment.