Refresh Data #25
Workflow file for this run
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: Refresh Data | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * 0' | |
jobs: | |
refresh-data: | |
name: Refresh Data | |
runs-on: ubuntu-latest | |
container: | |
image: cansav09/metricminer | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.METRICMINER_GITHUB_PAT }} | |
- name: Run metricminer get data script | |
env: | |
METRICMINER_CALENDLY: ${{ secrets.METRICMINER_CALENDLY }} | |
METRICMINER_GITHUB_PAT: ${{ secrets.METRICMINER_GITHUB_PAT }} | |
METRICMINER_GOOGLE_ACCESS: ${{ secrets.METRICMINER_GOOGLE_ACCESS }} | |
METRICMINER_GOOGLE_REFRESH: ${{ secrets.METRICMINER_GOOGLE_REFRESH }} | |
run: Rscript ".github/workflows/get_itn_data.R" | |
- name: Commit data files | |
env: | |
GH_PAT: ${{ secrets.GH_PAT }} | |
run: | | |
git config --global --add safe.directory $GITHUB_WORKSPACE | |
git config --global user.email "[email protected]" | |
git config --global user.name "cansavvy" | |
git remote set-url origin https://${GH_PAT}@github.com/${GITHUB_REPOSITORY} | |
git fetch origin | |
git add --force data/* | |
git commit -m 'Refresh data' || echo "No changes to commit" | |
git pull --allow-unrelated-histories --strategy-option=ours | |
git push -u origin main || echo "No changes to push" |