update-example-hub #12
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: workflow_dispatch | |
name: update-example-hub | |
jobs: | |
update-example-simple-forecast-hub: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Checkout hubEnsembles | |
uses: actions/checkout@v3 | |
- name: Checkout update_example_simple_forecast_hub branch, remove existing | |
run: | | |
git fetch --all | |
git branch update_example_simple_forecast_hub | |
git checkout update_example_simple_forecast_hub | |
git pull origin update_example_simple_forecast_hub | |
git rm -r inst/example-data/example-simple-forecast-hub/ | |
working-directory: ./hubEnsembles | |
- name: Checkout example-simple-forecast-hub | |
uses: actions/checkout@v3 | |
with: | |
repository: 'Infectious-Disease-Modeling-Hubs/example-simple-forecast-hub' | |
ref: 'main' | |
path: './hubEnsembles/inst/example-data/example-simple-forecast-hub' | |
- name: Push files to GitHub | |
run: | | |
git config --global user.email "git@github.com" | |
git config --global user.name "Github Actions CI" | |
echo "Committing files..." | |
rm -R inst/example-data/example-simple-forecast-hub/.git | |
git add inst/example-data/example-simple-forecast-hub | |
git commit -m "Github Actions build update example-simple-forecast-hub: $GITHUB_RUN_NUMBER" | |
echo "Pushing files..." | |
git push https://${GITHUB_TOKEN}@github.com/Infectious-Disease-Modeling-Hubs/hubEnsembles.git HEAD:update_example_simple_forecast_hub | |
echo "Submitting pull request..." | |
gh pr create --fill --base main --head update_example_simple_forecast_hub | |
working-directory: ./hubEnsembles |