-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (70 loc) · 3.36 KB
/
hitide_collections.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
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