HiTIDE Collections Update #38
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 Collections Update | |
# Controls when the workflow will run | |
on: | |
schedule: | |
- cron: '10 9 * * *' # Set the cron schedule for 1 am PST | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Refresh HiTIDE Collections 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 "[podaac-services-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 | |
echo "[podaac-services-uat]" >> ~/.aws/credentials | |
echo "aws_access_key_id=${{ secrets.AWS_ACCESS_KEY_ID_SERVICES_UAT }}" >> ~/.aws/credentials | |
echo "aws_secret_access_key=${{ secrets.AWS_SECRET_ACCESS_KEY_SERVICES_UAT }}" >> ~/.aws/credentials | |
echo "[ngap-cumulus-ops]" >> ~/.aws/credentials | |
echo "aws_access_key_id=${{ secrets.AWS_ACCESS_KEY_ID_CUMULUS_OPS }}" >> ~/.aws/credentials | |
echo "aws_secret_access_key=${{ secrets.AWS_SECRET_ACCESS_KEY_CUMULUS_OPS }}" >> ~/.aws/credentials | |
echo "[ngap-cumulus-uat]" >> ~/.aws/credentials | |
echo "aws_access_key_id=${{ secrets.AWS_ACCESS_KEY_ID_CUMULUS_UAT }}" >> ~/.aws/credentials | |
echo "aws_secret_access_key=${{ secrets.AWS_SECRET_ACCESS_KEY_CUMULUS_UAT }}" >> ~/.aws/credentials | |
######################################################################### | |
# 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 Collections Google Sheet | |
working-directory: hitide_collections | |
env: | |
CMR_USER: ${{ secrets.CMR_USER }} | |
CMR_PASS: ${{ secrets.CMR_PASS }} | |
AWS_DEFAULT_REGION: us-west-2 | |
SPREADSHEET_ID: ${{ secrets.HITIDE_COLLECTIONS_SHEET_ID }} | |
run: | | |
poetry run python hitide_collections.py -d data |