Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/blackformat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Black Code Formatter Check

on:
push:
branches: [ master ]
pull_request:

jobs:
Expand Down
71 changes: 71 additions & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: deployment

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
#when there is a push to the master
push:
branches: [ master ]
pull_request:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
#does this mean that the files in my github repo are accessible by this YAML file?
- uses: actions/checkout@v2

#installs a version of python, but I need this if deploying to a severless Python Lambda?
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.6'

#credentials to connect to AWS
# - name: Configure AWS credentials from Production account
# 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

# Runs a set of commands using the runners shell; THIS DOESN'T WORK
- name: Run a multi-line script
env:
DEBUG: 'False'
ENV: prod
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_STORAGE_BUCKET_NAME: ${{ secrets.AWS_STORAGE_BUCKET_NAME }}
run: |
#install PIP
python -m pip install --upgrade pip
cd src/
#install all dependencies as defined by requirements.txt in the current directory
pip3 install -r ../requirements.txt -t .
pip3 install python-dotenv==0.14.0
python manage.py collectstatic --noinput
zip -r ../pycon.zip .

#ensuring current working directory is accessible by the function--this might not be doing anything
export PATH=$PATH:$(pwd)

#${{ secrets.AWS_FUNCTION_NAME }}
#Deploy main.py to AWS
- name: AWS Lambda Deploy
uses: appleboy/lambda-action@v0.0.4
with:
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_region: us-east-1
#name of my AWS Lambda Function
function_name: pycon-demo-test
#contains all the files in my github repository
zip_file: pycon.zip