Skip to content

Commit

Permalink
dev work on release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
8naama authored May 2, 2024
2 parents d093217 + 33fcf2b commit 9ae2db0
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 59 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/auto-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Auto-deployment and Upload files to S3
on:
workflow_dispatch:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Copy 'src' directory into 'app' directory
run: |
cp -R src app
- name: Create 'upload' directory
run: |
mkdir -p upload
- name: Zip 'app' directory into 'upload' directory
run: |
zip -r upload/lambda_function_code.zip app
- name: Copy 'auto-deployment.yaml' to 'upload' directory
run: |
cp aws/auto-deployment.yaml upload
- name: Run python script that empty the S3 bucket and upload files in 'upload' directory to it with public-read
run: |
pip install boto3
python action/run.py
env:
SOURCE_DIR: upload
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
FOLDER_NAME: ${{ secrets.FOLDER_NAME }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
33 changes: 0 additions & 33 deletions .github/workflows/git-secrets.yml

This file was deleted.

33 changes: 7 additions & 26 deletions .github/workflows/workflow.yaml → .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
name: Automatic tests, code-coverage and auto-deployment files upload to S3
name: Automatic tests and code-coverage
on:
workflow_dispatch:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Copy 'src' directory into 'app' directory
run: |
cp -R src app
- name: Add S3 bucket name and aws keys to tests config file
run: |
sed -i 's/S3_BUCKET_NAME\b/${{ secrets.AWS_S3_BUCKET_TEST }}/1' tests/config.yaml
Expand Down Expand Up @@ -42,22 +42,3 @@ jobs:
if [ $exit_code -eq 1 ]; then
exit 1
fi
- name: Create 'upload' directory
run: |
mkdir -p upload
- name: Zip 'app' directory into 'upload' directory
run: |
zip -r upload/lambda_function_code.zip app
- name: Copy 'auto-deployment.yaml' to 'upload' directory
run: |
cp aws/auto-deployment.yaml upload
- name: Run python script that empty the S3 bucket and upload files in 'upload' directory to it with public-read
run: |
pip install boto3
python action/run.py
env:
SOURCE_DIR: upload
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
FOLDER_NAME: ${{ secrets.FOLDER_NAME }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

0 comments on commit 9ae2db0

Please sign in to comment.