From 3dfcdeb8c8f6fc88a22a05cd974f932443d29e37 Mon Sep 17 00:00:00 2001 From: "Pedro H. P. Almeida" Date: Mon, 8 Apr 2024 18:54:06 -0300 Subject: [PATCH] ci: test publish --- .github/workflows/publish.yaml | 30 ++++++++++++++++++++++++++++++ .github/workflows/workflow.yaml | 4 ++++ 2 files changed, 34 insertions(+) create mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..8170735 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,30 @@ +name: Deploy to lambda +on: [workflow_call] + +jobs: + deploy_zip: + name: Deploy Lambda function + runs-on: ubuntu-latest + steps: + - name: Checkout source code + uses: actions/checkout@v4 + + - name: Package dependencies + run: | + mkdir dependencies + pip install -r requirements.txt --target ./dependencies + zip -r dependencies.zip dependencies/ + + - name: Zip file + run: | + zip -r deploy.zip handler.py dependencies.zip + + # - name: default deploy + # uses: appleboy/lambda-action@v0.1.9 + # with: + # aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} + # aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + # aws_region: ${{ secrets.AWS_REGION }} + # handler: handler + # function_name: handler + # zip_file: deploy.zip diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index cff36c2..da85606 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -16,3 +16,7 @@ jobs: uses: PedroHPAlmeida/actions-workflows-python/.github/workflows/pytest.yaml@1.2 with: python-version: '3.10' + + deploy: + needs: test + uses: ./github/workflows/publish.yaml