diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml new file mode 100644 index 0000000..0ffb94f --- /dev/null +++ b/.github/workflows/deployment.yml @@ -0,0 +1,33 @@ +name: Deployment +on: + push: + branches: [ master ] +jobs: + deploy: + name: Deploy + runs-on: ubuntu-latest + steps: + - name: Checkout Github Source Code + uses: actions/checkout@v3 + + - name: Set Up Python 3.8 + uses: actions/setup-python@v4 + with: + python-version: "3.8" + - name: Get EB CLI version + run: | + python -m pip install --upgrade pip + pip install awsebcli --upgrade + eb --version + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v2 + 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: Create EBS application + run: | + eb init -p python-3.8 ${{ secrets.AWS_APPLICATION_NAME }} --region us-east-1 + - name: Create test environment & deploy + run: | + (eb use ${{ secrets.AWS_APPLICATION_ENVIRONMENT }} && eb status ${{ secrets.AWS_APPLICATION_ENVIRONMENT }} && eb deploy) || eb create ${{ secrets.AWS_APPLICATION_ENVIRONMENT }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 048c4d6..004dba2 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ /deb_dist/ /dist/ /helloworld.egg-info/ +.idea/