HiTIDE Granules Update #30
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: HiTIDE Granules Update | |
# Controls when the workflow will run | |
on: | |
schedule: | |
- cron: '10 10 * * *' # Set the cron schedule for 2am PST | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Refresh HiTIDE Granules Google Sheet | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
steps: | |
######################################################################### | |
# Environment Setup | |
######################################################################### | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install Poetry | |
uses: abatilo/[email protected] | |
with: | |
poetry-version: 1.8.3 | |
######################################################################### | |
# Install & Run Pylint & Flake | |
######################################################################### | |
- name: Poetry Steps | |
run: | | |
poetry install | |
# poetry run pylint ./* | |
# poetry run flake8 . | |
######################################################################### | |
# Setup AWS profiles | |
######################################################################### | |
- name: Configure custom AWS profile | |
run: | | |
mkdir -p ~/.aws | |
echo "[ngap-service-ops]" >> ~/.aws/credentials | |
echo "aws_access_key_id=${{ secrets.AWS_ACCESS_KEY_ID_SERVICES_OPS }}" >> ~/.aws/credentials | |
echo "aws_secret_access_key=${{ secrets.AWS_SECRET_ACCESS_KEY_SERVICES_OPS }}" >> ~/.aws/credentials | |
# Create the config file | |
echo "[ngap-service-ops]" >> ~/.aws/config | |
echo "region=us-west-2" >> ~/.aws/config | |
######################################################################### | |
# Setup Token for GSpread | |
######################################################################### | |
- name: Setup Token | |
env: | |
GOOGLE_TOKEN: ${{ secrets.GOOGLE_TOKEN }} | |
run: | | |
mkdir -p ~/.config/gspread | |
echo "$GOOGLE_TOKEN" > ~/.config/gspread/service_account.json | |
######################################################################### | |
# Start the Repo Status Updater | |
######################################################################### | |
- name: Update HiTIDE Granules Google Sheet | |
working-directory: hitide_granules | |
env: | |
CMR_USER: ${{ secrets.CMR_USER }} | |
CMR_PASS: ${{ secrets.CMR_PASS }} | |
AWS_DEFAULT_REGION: us-west-2 | |
COLLECTIONS_SPREADSHEET_ID: ${{ secrets.HITIDE_COLLECTIONS_SHEET_ID }} | |
SPREADSHEET_ID: ${{ secrets.HITIDE_GRANULES_SHEET_ID }} | |
run: | | |
poetry run python hitide_granules.py --config config.yml |