Skip to content

Update team page (Cron) #61

Update team page (Cron)

Update team page (Cron) #61

name: Update team page (Cron)
on:
schedule:
- cron: "00 01,13 * * *"
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set Git User Identity
run: |
git config --global user.email "[email protected]"
git config --global user.name "Repo Cronjob GitHub Actions"
git config --global user.name merge.renormalize true
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: Set PYTHONPATH
run: echo "PYTHONPATH=${{ github.workspace }}" >> $GITHUB_ENV
- name: Install dependencies with uv
run: uv sync
- name: Create env file
run: |
touch .env
echo "TEAM_SHEET_ID=${{secrets.TEAM_SHEET_ID}}" >> .env
echo "TEAM_WORKSHEET_NAME=${{secrets.TEAM_WORKSHEET_NAME}}" >> .env
echo "WEBSITE_REPOSITORY_TOKEN=${{secrets.WEBSITE_REPOSITORY_TOKEN}}" >> .env
cat .env
- name: Create .pytanis directory
run: |
mkdir /home/runner/.pytanis
- name: Just to DEBUG
run: |
ls -lha */*
- name: Create config.toml
working-directory: /home/runner/.pytanis
run: |
touch config.toml
echo "[Google]">>config.toml
echo 'client_secret_json = "client_secret.json"'>>config.toml
echo 'token_json = "token.json"'>>config.toml
# unused but required in Pytanis
echo "[HelpDesk]">>config.toml
echo "[Pretalx]">>config.toml
- name: Create Google Client Secret
working-directory: /home/runner/.pytanis
run: |
echo ${{ secrets.GOOGLE_CLIENT_SECRET }} | base64 -d > client_secret.json
- name: Create Google Token
working-directory: /home/runner/.pytanis
run: |
echo ${{ secrets.GOOGLGE_TOKEN_JSON }} | base64 -d > token.json
- name: Run team_page/mainy.py
working-directory: team_page
run: uv run python main.py