Latest city view #7975
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
on: | |
schedule: | |
- cron: '30 1,4,7,10,13,16,19,22 * * *' | |
workflow_dispatch: | |
name: Latest city view | |
jobs: | |
update: | |
name: Create new city | |
runs-on: macos-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token | |
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo | |
- uses: r-lib/actions/setup-r@v2 | |
- name: Install remotes and rcityviews packages | |
run: | | |
options("pkgType" = "binary") #see: https://github.com/r-lib/actions/issues/141#issuecomment-664390398 | |
install.packages("remotes") | |
remotes::install_github(repo = "koenderks/rcityviews", dependencies = TRUE) | |
shell: Rscript {0} | |
- name: Create new city | |
run: | | |
source(".github/workflows/action.R") | |
shell: Rscript {0} | |
- name: Commit files | |
run: | | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git commit -m "City update initialized by bot" -a | |
git reset --soft HEAD~2 | |
git commit -m "City update initialized by bot" -a | |
- name: Push force changes | |
uses: ad-m/github-push-action@master | |
with: | |
force: true | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} |