Update CSV and Deploy to GitHub Pages #145
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: Update CSV and Deploy to GitHub Pages | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '0 6 * * *' | |
- cron: '0 18 * * *' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.x | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Run update_sw_eventlist.py | |
env: | |
DOORKEEPER_API_KEY: ${{ secrets.DOORKEEPER_API_KEY }} | |
run: python update_sw_eventlist.py | |
- name: Clean up files | |
run: | | |
mkdir public | |
cp index.html public/ | |
cp startup_weekend_events.csv public/ | |
cp last_run_time.txt public/ | |
cp streamlit_app.py public/ | |
- name: Deploy to GitHub Pages | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: public | |
deploy: | |
needs: build | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 |