2023.5.1 #105
Workflow file for this run
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
# This workflow will install Python dependencies, | |
# run the python script to generate the database, | |
# and upload the regenerated database to the binary repo | |
name: Generate Database | |
on: | |
# More details on trigger events: https://docs.github.com/en/actions/reference/events-that-trigger-workflows | |
workflow_dispatch: # manual execution | |
release: | |
types: [published] | |
branches: [main] | |
jobs: | |
build: | |
# Only run for the SIMPLE-AstroDB/SIMPLE-db repo, not on any forks | |
if: github.repository == 'SIMPLE-AstroDB/SIMPLE-db' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install astrodbkit2 | |
- name: Generate sqlite (file) database | |
run: | | |
python scripts/tutorials/generate_database.py sqlite | |
working-directory: . | |
# The postgres database creation can take a while on the hobby-dev tier in Heroku | |
# Disabling until we have a better idea on how to use this | |
# - name: Generate postgres (Heroku) database | |
# env: | |
# SIMPLE_DATABASE_URL: ${{secrets.SIMPLE_DATABASE_URL}} | |
# run: | | |
# pip install psycopg2 | |
# python scripts/tutorials/generate_database.py postgres | |
# working-directory: . | |
- name: Push database file | |
uses: dmnemec/copy_file_to_another_repo_action@main | |
# Details for this action at https://github.com/marketplace/actions/push-a-file-to-another-repository | |
env: | |
API_TOKEN_GITHUB: ${{ secrets.SIMPLE_TOKEN }} | |
with: | |
source_file: 'SIMPLE.db' | |
destination_repo: 'SIMPLE-AstroDB/SIMPLE-binary' | |
destination_branch: 'main' | |
user_email: '[email protected]' | |
user_name: 'github-actions' |