Update Timetables #11901
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: Update Timetables | |
on: | |
workflow_dispatch: | |
schedule: | |
# Run every hour at 10 minutes. | |
- cron: '10 * * * *' | |
push: | |
branches: ['main'] | |
paths: | |
- '.github/workflows/timetables.yml' | |
- 'timetables/**' | |
permissions: | |
# Set GITHUB_TOKEN permissions for GitHub Pages deployment. | |
pages: write | |
id-token: write | |
# Set GITHUB_TOKEN permissions to commit and push changes. | |
contents: write | |
concurrency: | |
# Allow only one concurrent deployment, skip runs queued between the run in-progress and latest queued. | |
group: 'pages' | |
# Cancel in-progress runs as we do NOT want to allow these production deployments to complete. | |
cancel-in-progress: false | |
jobs: | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Create GitHub App Token | |
uses: actions/[email protected] | |
id: app-token | |
with: | |
app-id: ${{ vars.ACTIONS_BYPASS_BOT_APP_ID }} | |
private-key: ${{ secrets.ACTIONS_BYPASS_BOT_PRIVATE_KEY }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ steps.app-token.outputs.token }} | |
- uses: denoland/setup-deno@v1 | |
with: | |
deno-version: v1.x | |
- name: Run Deno Script | |
run: deno run --allow-net --allow-read --allow-write --allow-env timetables/run.ts | |
- run: git pull | |
- uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: Update Timetables | |
file_pattern: 'public/timetables/*.json' | |
commit_author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | |
- name: Setup Pages | |
uses: actions/configure-pages@v4 | |
- name: Generate Directory Listings | |
uses: jayanta525/[email protected] | |
with: | |
FOLDER: 'public' | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: 'public' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |