Skip to content

Commit

Permalink
Merge branch 'yihong0618-master'
Browse files Browse the repository at this point in the history
* yihong0618-master: (33 commits)
  Fix codoon and Upload tcx_to_garmin (yihong0618#662)
  Update README-CN.md (yihong0618#663)
  add keep2strava (yihong0618#653)
  Add data to 'running page runners' table (yihong0618#656)
  style: use Tailwind CSS (yihong0618#655)
  feat: fill country (yihong0618#654)
  docs: add runner (yihong0618#651)
  doc: add new runner
  docs: update README (yihong0618#650)
  docs: add a comment in `src/utils/consts.ts` to remind about security considerations regarding the `MAPBOX_TOKEN` (yihong0618#644)
  fix: no package manager
  fix: tachyons-sass import error (yihong0618#639)
  Update README.md (yihong0618#638)
  Add proxy config, add keep config, change npm registry, use yarn (yihong0618#634)
  chore: fix typo (yihong0618#633)
  chore: Update package manager and ignore requirements-dev.txt (yihong0618#632)
  add run.drink.cafe (yihong0618#628)
  feat: coros sync (yihong0618#623)
  Fix README typo (yihong0618#624)
  fix: ts type error (yihong0618#622)
  ...
  • Loading branch information
chensoul committed Apr 26, 2024
2 parents deb664a + 28c4fde commit 81cb2d0
Show file tree
Hide file tree
Showing 74 changed files with 6,829 additions and 730 deletions.
File renamed without changes.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: ['3.8', '3.9', '3.10']
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
id: setup_python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# if your default branches is not master, please change it here
ref: master

- name: Cache Data Files
if: inputs.save_data_in_github_cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
activities
Expand All @@ -71,9 +71,9 @@ jobs:
${{ inputs.data_cache_prefix }}-
- name: Setup Node.js environment
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '20'

- uses: pnpm/action-setup@v2
name: Install pnpm
Expand All @@ -86,7 +86,7 @@ jobs:
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
Expand All @@ -101,10 +101,10 @@ jobs:
run: PATH_PREFIX=/ pnpm build

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v2
with:
# Upload dist repository
path: './dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v3
38 changes: 33 additions & 5 deletions .github/workflows/run_data_sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,19 @@ on:
- run_page/strava_sync.py
- run_page/gen_svg.py
- run_page/garmin_sync.py
- run_page/coros_sync.py
- run_page/keep_sync.py
- run_page/gpx_sync.py
- run_page/tcx_sync.py
- run_page/tcx_to_garmin_sync.py
- run_page/garmin_to_strava_sync.py
- run_page/keep_to_strava_sync.py
- run_page/oppo_sync.py
- requirements.txt

env:
# please change to your own config.
RUN_TYPE: strava # support strava/nike/garmin/garmin_cn/keep/only_gpx/only_fit/nike_to_strava/strava_to_garmin/strava_to_garmin_cn/garmin_to_strava/garmin_to_strava_cn/codoon, Please change the 'pass' it to your own
RUN_TYPE: strava # support strava/nike/garmin/coros/garmin_cn/garmin_sync_cn_global/keep/only_gpx/only_fit/nike_to_strava/strava_to_garmin/tcx_to_garmin/strava_to_garmin_cn/garmin_to_strava/garmin_to_strava_cn/codoon/oppo, Please change the 'pass' it to your own
ATHLETE: chensoul
TITLE: Chensoul Running
MIN_GRID_DISTANCE: 10 # change min distance here
Expand Down Expand Up @@ -49,11 +53,11 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python
id: setup_python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: pip
Expand All @@ -65,7 +69,7 @@ jobs:
- name: Cache Data Files
if: env.SAVE_DATA_IN_GITHUB_CACHE == 'true'
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
activities
Expand Down Expand Up @@ -97,6 +101,17 @@ jobs:
run: |
python run_page/keep_sync.py ${{ secrets.KEEP_MOBILE }} ${{ secrets.KEEP_PASSWORD }} --with-gpx
- name: Run sync Coros script
if: env.RUN_TYPE == 'coros'
run: |
python run_page/coros_sync.py ${{ secrets.COROS_ACCOUNT }} ${{ secrets.COROS_PASSWORD }}
- name: Run sync Keep_to_strava script
if: env.RUN_TYPE == 'keep_to_strava_sync'
run: |
python run_page/keep_to_strava_sync.py ${{ secrets.KEEP_MOBILE }} ${{ secrets.KEEP_PASSWORD }} ${{ secrets.STRAVA_CLIENT_ID }} ${{ secrets.STRAVA_CLIENT_SECRET }} ${{ secrets.STRAVA_CLIENT_REFRESH_TOKEN }} --sync-types running cycling hiking
# If you only want to sync `type running` modify args --sync-types running, default script is to sync all data (rides, hikes and runs).

- name: Run sync Strava script
if: env.RUN_TYPE == 'strava'
run: |
Expand All @@ -108,6 +123,12 @@ jobs:
run: |
python run_page/codoon_sync.py ${{ secrets.CODOON_MOBILE }} ${{ secrets.CODOON_PASSWORD }}
- name: Run sync tcx to Garmin script
if: env.RUN_TYPE == 'tcx_to_garmin'
run: |
# python run_page/tcx_to_garmin_sync.py ${{ secrets.GARMIN_SECRET_STRING }}
python run_page/tcx_to_garmin_sync.py ${{ secrets.GARMIN_SECRET_STRING_CN }} --is-cn
# for garmin if you want generate `tcx` you can add --tcx command in the args.
- name: Run sync Garmin script
if: env.RUN_TYPE == 'garmin'
Expand All @@ -133,7 +154,7 @@ jobs:
# If you only want to sync `type running` add args --only-run, default script is to sync all data (rides and runs).
# python run_page/garmin_sync_cn_global.py ${{ secrets.GARMIN_SECRET_STRING_CN }} ${{ secrets.GARMIN_SECRET_STRING }} --only-run


- name: Run sync Only GPX script
if: env.RUN_TYPE == 'only_gpx'
run: |
Expand Down Expand Up @@ -174,6 +195,13 @@ jobs:
run: |
python run_page/tulipsport_sync.py ${{ secrets.TULIPSPORT_TOKEN }} --with-gpx
- name: Run sync Oppo heytap script, note currently this script is not worked
if: env.RUN_TYPE == 'oppo'
run: |
python run_page/oppo_sync.py ${{ secrets.OPPO_ID }} ${{ secrets.OPPO_CLIENT_SECRET }} ${{ secrets.OPPO_CLIENT_REFRESH_TOKEN }} --with-tcx
# If you want to sync fit activity in gpx format, please consider the following script:
# python run_page/oppo_sync.py ${{ secrets.OPPO_ID }} ${{ secrets.OPPO_CLIENT_SECRET }} ${{ secrets.OPPO_CLIENT_REFRESH_TOKEN }} --with-gpx

- name: Make svg GitHub profile
if: env.RUN_TYPE != 'pass'
run: |
Expand Down
1 change: 1 addition & 0 deletions .prettierrc.js → .prettierrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ module.exports = {
semi: true,
bracketSpacing: true,
singleQuote: true,
plugins: ['prettier-plugin-tailwindcss']
};
1 change: 1 addition & 0 deletions .vercelignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
requirements.txt
requirements-dev.txt
15 changes: 10 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
FROM python:3.10.5-slim AS develop-py
WORKDIR /root/running_page
COPY ./requirements.txt /root/running_page/requirements.txt
# Add proxy for apt.
# ENV http_proxy http://ip_address:port
# ENV https_proxy http://ip_address:port
RUN apt-get update \
&& apt-get install -y --no-install-recommends git \
&& apt-get purge -y --auto-remove \
Expand All @@ -14,12 +17,10 @@ FROM node:18 AS develop-node
WORKDIR /root/running_page
COPY ./package.json /root/running_page/package.json
COPY ./pnpm-lock.yaml /root/running_page/pnpm-lock.yaml
RUN npm config set registry https://registry.npm.taobao.org \
RUN npm config rm proxy&&npm config set registry https://registry.npmjs.org/ \
&&npm install -g corepack \
&&corepack enable \
&&pnpm install


&&yarn install

FROM develop-py AS data
ARG app
Expand All @@ -29,6 +30,8 @@ ARG client_id
ARG client_secret
ARG refresh_token
ARG YOUR_NAME
ARG keep_phone_number
ARG keep_password

WORKDIR /root/running_page
COPY . /root/running_page/
Expand All @@ -45,6 +48,8 @@ RUN DUMMY=${DUMMY}; \
python3 run_page/strava_sync.py ${client_id} ${client_secret} ${refresh_token};\
elif [ "$app" = "Nike_to_Strava" ] ; then \
python3 run_page/nike_to_strava_sync.py ${nike_refresh_token} ${client_id} ${client_secret} ${refresh_token};\
elif [ "$app" = "Keep" ] ; then \
python3 run_page/keep_sync.py ${keep_phone_number} ${keep_password};\
else \
echo "Unknown app" ; \
fi
Expand All @@ -56,7 +61,7 @@ RUN python3 run_page/gen_svg.py --from-db --title "my running page" --type grid
FROM develop-node AS frontend-build
WORKDIR /root/running_page
COPY --from=data /root/running_page /root/running_page
RUN pnpm run build
RUN yarn run build

FROM nginx:alpine AS web
COPY --from=frontend-build /root/running_page/dist /usr/share/nginx/html/
Expand Down
Loading

0 comments on commit 81cb2d0

Please sign in to comment.