Get data from GA #1746
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
--- | |
name: Get data from GA | |
on: | |
schedule: | |
# * is a special character in YAML so you have to quote this string | |
- cron: '57 21 * * *' | |
workflow_dispatch: | |
env: | |
python-version: '3.10' | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ env.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ env.python-version }} | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: install python requirements | |
run: pip install -r requirements.txt | |
- name: get data | |
run: | | |
make public/data | |
echo $TOKEN > token.json | |
python analytics.py | |
env: | |
TOKEN: ${{ secrets.TOKEN }} | |
PROPERTY_ID: ${{ secrets.PROPERTY_ID }} | |
- name: deploy to github pages | |
if: success() | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_branch: data | |
publish_dir: public/data | |
user_name: 'github-actions[bot]' | |
user_email: 'github-actions[bot]@users.noreply.github.com' |