Skip to content

Implements Riot Sign On (#3) #4

Implements Riot Sign On (#3)

Implements Riot Sign On (#3) #4

name: Deploy to AWS Elastic Beanstalk Production
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.12 ]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black ruff
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run Black
run: black --check project
- name: Run Ruff
run: ruff check project
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Rename docker-compose.prod.yml to docker-compose.yml
run: mv docker-compose.prod.yml docker-compose.yml
- name: Remove docker-compose.dev.yml
run: rm -f docker-compose.dev.yml
- name: Copy Elastic Beanstalk Config
run: |
mkdir -p .elasticbeanstalk
echo "${{ secrets.EB_CONFIG }}" > .elasticbeanstalk/config.yml
- name: Generate Deployment Package
run: |
mkdir -p deploy
zip -r deploy/deploy.zip .
- name: Get current time
uses: 1466587594/get-current-time@v2
id: current-time
with:
format: YYYY-MM-DDTHH-mm-ss
utcOffset: "+09:00"
- name: Beanstalk Deploy
uses: einaregilsson/beanstalk-deploy@v22
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
application_name: duofinder
environment_name: ${{ secrets.ENVIRONMENT_NAME }}
version_label: github-action-${{steps.current-time.outputs.formattedTime}}
region: ap-northeast-2
deployment_package: deploy/deploy.zip