Update project deployment naming convention #27
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: Deployment (Staging) | |
on: | |
push: | |
branches: | |
- "*" | |
concurrency: | |
group: merge-${{ github.ref }} | |
jobs: | |
Test: | |
runs-on: ubuntu-latest | |
environment: Staging | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
cache: 'pip' | |
- run: pip install -r requirements.txt | |
- name: Run tests | |
run: pytest | |
# - name: Upload coverage reports to Codecov | |
# uses: codecov/codecov-action@v4 | |
# with: | |
# token: ${{ secrets.CODECOV_TOKEN }} | |
Deploy: | |
needs: Test | |
runs-on: ubuntu-latest | |
environment: Staging | |
env: | |
MONGODB_URI: ${{ secrets.MONGODB_URI }} | |
MONGODB_DB_NAME: ${{ secrets.MONGODB_DB_NAME }} | |
UPSTASH_REDIS_REST_URL: ${{ secrets.UPSTASH_REDIS_REST_URL }} | |
UPSTASH_REDIS_REST_TOKEN: ${{ secrets.UPSTASH_REDIS_REST_TOKEN }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
cache: 'pip' | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-region: ${{ vars.AWS_REGION }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
- name: Create Package for AWS Lambda Layer | |
run: | | |
python -m venv python | |
source python/bin/activate | |
pip install -r requirements.txt -t python | |
python create_package_zip.py | |
- uses: pulumi/actions@v5 | |
with: | |
command: up | |
stack-name: sgcarstrends/staging | |
env: | |
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} |