Skip to content

chore: Make pypgstac an ENV in dockerfile (#404) #139

chore: Make pypgstac an ENV in dockerfile (#404)

chore: Make pypgstac an ENV in dockerfile (#404) #139

Workflow file for this run

name: Develop - Lint, Test, and Deploy Workflow
on:
push:
branches:
- develop
jobs:
lint-dev:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .[dev,deploy,test]
- name: Run pre-commit
run: pre-commit run --all-files
test-dev:
needs: [lint-dev]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .[dev,deploy,test]
- name: Launch services
run: AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY=${{secrets.AWS_SECRET_ACCESS_KEY}} docker compose up --build -d
- name: Ingest Stac Items/Collection
run: |
./scripts/load-data-container.sh
- name: Sleep for 10 seconds
run: sleep 10s
shell: bash
- name: Integrations tests
run: python -m pytest .github/workflows/tests/ -vv -s
- name: Install reqs for ingest api
run: python -m pip install -r ingest_api/runtime/requirements_dev.txt
- name: Install veda auth for ingest api
run: python -m pip install common/auth
- name: Ingest unit tests
run: NO_PYDANTIC_SSM_SETTINGS=1 python -m pytest ingest_api/runtime/tests/ -vv -s
- name: Stop services
run: docker compose stop
pre-release:
needs: [test-dev]
runs-on: ubuntu-latest
concurrency: release
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Python Semantic Release
uses: python-semantic-release/python-semantic-release@master
with:
changelog: "false"
github_token: ${{ secrets.GITHUB_TOKEN }}
deploy-dev:
needs: [pre-release]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Configure awscli
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- name: Install CDK
run: npm install -g aws-cdk@2
- uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .[dev,deploy,test]
- name: Get dev environment configuration for develop branch
run: ./scripts/get-env.sh "veda-backend-uah-dev-env"
- name: Deploy
run: |
echo $STAGE
cdk deploy --require-approval never --outputs-file ${HOME}/cdk-outputs.json