fix: remove statement and additional resource policies #472
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: Deploy APT API | |
on: | |
workflow_dispatch: # allows for manual invocation | |
push: | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup python 3 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install APT-GET dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libxml2-dev libxmlsec1-dev libxmlsec1-openssl | |
- name: Install python dependencies | |
run: | | |
pip install --upgrade pip setuptools wheel | |
pip install -e .[dev] --no-binary xmlsec | |
- name: Run linting | |
run: | | |
pre-commit run -vvv --all-files | |
# test: | |
# needs: [lint] | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v2 | |
# - name: Setup python 3 | |
# uses: actions/setup-python@v2 | |
# with: | |
# python-version: 3.8 | |
# - name: Install APT-GET dependencies | |
# run: | | |
# sudo apt-get update | |
# sudo apt-get install -y libxml2-dev libxmlsec1-dev libxmlsec1-openssl | |
# sudo apt-get install texlive-latex-recommended texlive-xetex latexmk | |
# - name: Install Python dependencies | |
# run: | | |
# pip install --upgrade pip setuptools wheel | |
# pip install -e .[test] --no-binary xmlsec | |
# - name: Run tests | |
# run: pytest tests --cov app --cov-report term-missing --ignore=venev | |
deploy-staging: | |
needs: [lint] | |
if: (github.event.ref == 'refs/heads/develop') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup python 3 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Setup Node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 18 | |
- name: Configure awscli | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.DS_AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.DS_AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-east-1 | |
- name: Make .env file | |
run: | | |
cat <<EOF >> .env | |
STAGE=staging | |
API_VERSION_STRING=/v2 | |
# Frontend Url used to set CORS origin for FastAPI | |
APT_FRONTEND_URL=https://d3p0lkft682kz.cloudfront.net | |
NOTIFICATIONS_FROM="[email protected]" | |
APT_FEATURE_JOURNAL_PDF_EXPORT_ENABLED="true" | |
DATABASE_FROM_SNAPSHOT_ID="nasa-apt-api-staging-db-encrypted" | |
EOF | |
- name: Install APT dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libxml2-dev libxmlsec1-dev libxmlsec1-openssl | |
- name: Install python dependencies | |
run: | | |
pip install --upgrade pip setuptools wheel | |
pip install -e .[deploy] --no-binary xmlsec | |
- name: Install CDK | |
# upgrade cdk version to latest | |
run: npm install -g [email protected] | |
# CDK warning 19836 regarding cdk version blocks CDK bootstrap | |
- name: Bootstrap CDK | |
run: | | |
cdk acknowledge 19836 | |
cdk bootstrap | |
- name: Deploy stack | |
run: | | |
cdk acknowledge 19836 | |
cdk synth nasa-apt-api-staging | |
cdk deploy nasa-apt-api-staging --require-approval never | |
# deploy-prod: | |
# needs: [test] | |
# if: github.event.ref == 'refs/heads/master' | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v2 | |
# - name: Setup python 3 | |
# uses: actions/setup-python@v2 | |
# with: | |
# python-version: 3.8 | |
# - name: Setup Node | |
# uses: actions/setup-node@v1 | |
# with: | |
# node-version: 14 | |
# - name: Configure awscli | |
# uses: aws-actions/configure-aws-credentials@v1 | |
# with: | |
# aws-access-key-id: ${{ secrets.UAH_AWS_ACCESS_KEY_ID }} | |
# aws-secret-access-key: ${{ secrets.UAH_AWS_SECRET_ACCESS_KEY }} | |
# aws-region: us-east-2 | |
# - name: Make .env file | |
# run: | | |
# cat <<EOF >> .env | |
# STAGE=prod | |
# API_VERSION_STRING=/v2 | |
# # Frontend Url used to set CORS origin for FastAPI | |
# APT_FRONTEND_URL=https://impact.earthdata.nasa.gov/apt | |
# NOTIFICATIONS_FROM="[email protected]" | |
# EOF | |
# - name: Install APT dependencies | |
# run: | | |
# sudo apt-get update | |
# sudo apt-get install -y libxml2-dev libxmlsec1-dev libxmlsec1-openssl | |
# - name: Install python dependencies | |
# run: | | |
# pip install --upgrade pip setuptools wheel | |
# pip install -e .[deploy] --no-binary xmlsec | |
# - name: Install CDK | |
# run: npm install -g [email protected] | |
# - name: Bootstrap CDK | |
# run: cdk bootstrap | |
# - name: Deploy stack | |
# run: cdk deploy nasa-apt-api-lambda-prod --require-approval never |