Synchronize users #15551
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Two roles: | |
# 1. Runs often to avoid Supabase to enter sleep-mode (https://supabase.com/docs/going-into-prod#availability) | |
# 2. Synchronize the player-table in the database with the memberships on TIHLDE.org | |
# | |
# An auth token from tihlde.org MUST be set as a secret in TIHLDE_AUTH_TOKEN | |
# Since the is needed at the /api/refresh-players endpoint | |
name: Synchronize users | |
on: | |
schedule: | |
- cron: 0 * * * * | |
workflow_dispatch: | |
jobs: | |
synchronize: | |
name: Synchronize users | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
url: ['https://pythons.tihlde.org', 'https://pythons-damer.tihlde.org'] | |
steps: | |
- name: Synchronize users | |
id: request | |
uses: fjogeleit/http-request-action@v1 | |
with: | |
url: '${{ matrix.url }}/api/refresh-players' | |
method: 'POST' | |
timeout: 20000 | |
data: '{"authToken": "${{ secrets.TIHLDE_AUTH_TOKEN }}"}' | |
- name: Respons | |
run: | | |
echo ${{ steps.request.outputs.response }} |