Skip to content

Merge pull request #122 from joshkotrous/main #40

Merge pull request #122 from joshkotrous/main

Merge pull request #122 from joshkotrous/main #40

Workflow file for this run

name: EB Deploy
on:
push:
branches:
- test
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Set up Python 3.11
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Migrate DB
env:
AWS_REGION: us-west-2
AWS_DB_SECRET_NAME: ${{ secrets.AWS_DB_SECRET_NAME }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
DATABASE_HOST: ${{ secrets.DATABASE_HOST }}
DATABASE_NAME: devume
DATABASE_PORT: 5432
DATABASE_USERNAME: postgres
DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD }}
run: |
python manage.py makemigrations
python manage.py migrate
- name: Generate deployment package
run: zip -r deploy.zip . -x '*.git*'
- name: Deploy to EB
uses: einaregilsson/beanstalk-deploy@v22
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
application_name: devume-test
environment_name: devume-test
version_label: ${{ github.sha }}
region: us-west-2
deployment_package: deploy.zip
use_existing_version_if_available: true