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: Push 'latest.csv' to public repo | |
on: | |
push: | |
paths: | |
- 'processed/latest.csv' | |
jobs: | |
commit-latest: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
path: 'src' | |
ref: 'master' | |
- name: Checkout destination repository | |
uses: actions/checkout@v4 | |
with: | |
path: 'dest' | |
ref: 'master' | |
repository: 'GrupoDaMudanca/cod-results' | |
ssh-key: ${{ secrets.PUSH_COD_SSH_KEY }} | |
- name: Set up Git user for the action | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
- name: Copy the latest.csv file to the target repository | |
shell: bash | |
run: | | |
cp src/processed/latest.csv dest/latest.csv | |
- name: Commit and push changes to the target repository | |
shell: bash | |
working-directory: dest | |
run: | | |
git add latest.csv | |
git commit -m "Update data $(date -u '+%Y-%m-%d %T') UTC" | |
git push |