Keep Streamlit App Alive via Commit #10496
This file contains hidden or 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: Keep Streamlit App Alive via Commit | |
| on: | |
| schedule: | |
| # Runs every 30 minutes | |
| - cron: '*/30 * * * *' | |
| workflow_dispatch: | |
| jobs: | |
| keep-alive: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout streamlit-prod branch | |
| uses: actions/checkout@v3 | |
| with: | |
| ref: streamlit-prod # Ensures we are on the correct branch | |
| - name: Configure Git | |
| run: | | |
| git config --global user.name 'github-actions[bot]' | |
| git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
| - name: Create Dummy Commit | |
| run: | | |
| # The --allow-empty flag is crucial as it creates a commit even if there are no changes. | |
| git commit --allow-empty -m "feat: Keep-alive commit" | |
| - name: Push Dummy Commit | |
| run: | | |
| # Pushes the commit to the streamlit-prod branch to trigger a redeployment. | |
| git push origin streamlit-prod |