Skip to content

Generate DB and Create Release #10

Generate DB and Create Release

Generate DB and Create Release #10

Workflow file for this run

name: Generate DB and Create Release
on:
push:
branches:
- main
schedule:
- cron: '0 0 * * *' # Run daily at midnight UTC
workflow_dispatch: # Allows triggering the workflow manually from the GitHub UI
# Add permissions configuration
permissions:
contents: write # Required for creating releases
jobs:
build_and_release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4 # Checkout the repository code
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x' # Use your desired Python version
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Create data directory
run: mkdir -p data # Ensure the data directory exists
- name: Run database generation script
run: python scripts/download_issues.py # Execute your local script
env:
GITHUB_TOKEN: ${{ secrets.PAT }} # Pass PAT as GITHUB_TOKEN to the script
- name: Get current date for release name
id: get_date
run: echo "RELEASE_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV # Set environment variable with current date and time
- name: Create Release and Upload Database File
uses: softprops/action-gh-release@v1
with:
# Use the current date for the release name
name: ${{ env.RELEASE_DATE }}
# Use a consistent tag name that will be overwritten
# This way we aren't publishing an ever-increasing amount of data.
tag_name: latest
# Attach all files from the data directory
files: data/*
env:
GITHUB_TOKEN: ${{ secrets.PAT }} # Use personal access token instead of default token