From 5f2c79178dd6ab0870fb831fb7aee1a90eab878a Mon Sep 17 00:00:00 2001 From: Simon Alibert Date: Sun, 26 Nov 2023 15:31:28 +0100 Subject: [PATCH] :construction_worker: Caching poetry for faster CI --- .github/workflows/deploy.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d1c00ec..904ae73 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,4 +1,4 @@ -name: Connect to AWS role, build and push to ECR +name: Deploy code to AWS lambda on: push: @@ -17,15 +17,15 @@ jobs: steps: - name: Git clone the repository uses: actions/checkout@v4 + - name: Load cached $HOME/.local + uses: actions/cache@v3 + with: + path: ~/.local + key: dotlocal-${{ runner.os }}-${{ hashFiles('.github/workflows/deploy.yml') }} - name: Install poetry & poetry export run: | pipx install poetry pipx inject poetry poetry-plugin-export - - name: Cache poetry - uses: actions/setup-python@v4 - with: - python-version: '3.10' - cache: 'poetry' - name: Export requirements.txt run: poetry export -f requirements.txt --output requirements.txt --without-hashes - name: Configure aws credentials @@ -37,13 +37,13 @@ jobs: - name: Login to Amazon ECR id: login-ecr uses: aws-actions/amazon-ecr-login@v2 - - name: Build, tag, and push image to Amazon ECR + - name: Build, tag and push image to Amazon ECR env: ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} run: | docker build --platform linux/amd64 -t $ECR_REGISTRY/inews:latest . docker push $ECR_REGISTRY/inews:latest - - name: Updating lambda + - name: Update lambda code env: ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} run: |