70 lines
2.5 KiB
YAML
Executable File
70 lines
2.5 KiB
YAML
Executable File
name: Periodic refresh of events
|
|
run-name: Periodic refresh
|
|
on:
|
|
workflow_dispatch:
|
|
schedule:
|
|
- cron: '*/30 * * * *'
|
|
|
|
jobs:
|
|
Run-Scraper:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
#----------------------------------------------
|
|
# check-out repo and set-up python
|
|
#----------------------------------------------
|
|
- name: Check out repository code
|
|
uses: actions/checkout@v4
|
|
- name: Set up python
|
|
id: setup-python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.12'
|
|
#----------------------------------------------
|
|
# ----- install & configure poetry -----
|
|
#----------------------------------------------
|
|
- name: Install Poetry
|
|
uses: snok/install-poetry@v1
|
|
with:
|
|
virtualenvs-create: true
|
|
virtualenvs-in-project: true
|
|
virtualenvs-path: .venv
|
|
installer-parallel: true
|
|
|
|
#----------------------------------------------
|
|
# load cached venv if cache exists
|
|
#----------------------------------------------
|
|
- name: Load cached venv
|
|
id: cached-poetry-dependencies
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: .venv
|
|
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
|
|
#----------------------------------------------
|
|
# install dependencies if cache does not exist
|
|
#----------------------------------------------
|
|
- name: Install dependencies
|
|
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
|
|
run: poetry install --no-interaction --no-root
|
|
#----------------------------------------------
|
|
# install and run the project
|
|
#----------------------------------------------
|
|
- name: Install package
|
|
run: poetry install --no-interaction
|
|
- name: Generate New Calendar Files
|
|
run: poetry run generate-ics
|
|
#----------------------------------------------
|
|
# publish artifacts and release
|
|
#----------------------------------------------
|
|
- name: Archive production artifacts
|
|
uses: christopherhx/gitea-upload-artifact@v4
|
|
with:
|
|
name: calendars
|
|
path: |
|
|
output/
|
|
- name: Use Go Action
|
|
id: use-go-action
|
|
uses: https://gitea.com/actions/release-action@main
|
|
with:
|
|
files: |-
|
|
output/**
|
|
api_key: '${{secrets.RELEASE_TOKEN}}' |