Skip to content

Merge pull request #129 from Metro-Records/feature/127-staging-url #242

Merge pull request #129 from Metro-Records/feature/127-staging-url

Merge pull request #129 from Metro-Records/feature/127-staging-url #242

Workflow file for this run

name: CI
on:
push:
branches:
- main
- deploy
pull_request:
branches:
- main
jobs:
test:
name: Run tests
runs-on: ubuntu-latest
services:
postgres:
image: postgres:9.4
env:
POSTGRES_DB: lametro
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
id: setup-python
with:
python-version: '3.10'
- name: Install dependencies
run: |
AIRFLOW_VERSION=2.6.0
PYTHON_VERSION=$(echo ${{ steps.setup-python.outputs.python-version }} | cut -d "." -f 1-2)
CONSTRAINT_URL="https://raw.githubusercontent.com/apache/airflow/constraints-${AIRFLOW_VERSION}/constraints-${PYTHON_VERSION}.txt"
python -m pip install --upgrade pip
pip install "apache-airflow[s3,docker]==${AIRFLOW_VERSION}" --constraint "${CONSTRAINT_URL}"
pip install -r requirements.txt
- name: Test Airflow init
run: |
airflow db init
deploy:
needs: test
name: Deploy to AWS
runs-on: ubuntu-latest
steps:
- uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- uses: actions/checkout@v2
- id: deploy
uses: webfactory/[email protected]
with:
application: la-metro-dashboard