Update pipenv lockfile #52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: deploy | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "handler.py" | |
| - "Pipfile*" | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - "handler.py" | |
| - "Pipfile*" | |
| - "requirements.txt" | |
| - ".github/workflows/deploy.yml" | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: "3.14" | |
| architecture: "x64" | |
| cache: "pipenv" | |
| cache-dependency-path: Pipfile.lock | |
| - name: Install pipenv | |
| run: | | |
| pip install --prefer-binary -r requirements.txt | |
| pipenv install --dev | |
| - name: Check linting & formatting | |
| run: | | |
| pipenv run flake8 . | |
| pipenv run black --check . | |
| package: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: "3.14" | |
| architecture: "x64" | |
| cache: "pipenv" | |
| cache-dependency-path: Pipfile.lock | |
| - name: Install pipenv | |
| run: | | |
| pip install --prefer-binary -r requirements.txt | |
| pipenv install | |
| - name: Create deployment package | |
| run: | | |
| pipenv requirements > requirements.txt | |
| pip install --prefer-binary -r requirements.txt --target ${{ github.workspace }}/package | |
| cp handler.py ${{ github.workspace }}/package | |
| - name: Upload package | |
| if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: lambda-package | |
| path: ${{ github.workspace}}/package | |
| overwrite: true | |
| retention-days: 1 | |
| if-no-files-found: error | |
| deploy: | |
| runs-on: ubuntu-latest | |
| environment: AWS | |
| if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' | |
| needs: [package, check] | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| - name: Download package | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| path: ${{ github.workspace }}/package | |
| - name: Configure AWS Credentials | |
| uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0 | |
| with: | |
| aws-region: ${{ vars.AWS_REGION }} | |
| role-to-assume: ${{ secrets.AWS_ROLE }} | |
| - name: Deploy | |
| uses: aws-actions/aws-lambda-deploy@29ea35c124579506cf0475e20df36198eb670d89 # v1.1.0 | |
| with: | |
| function-name: ${{ vars.LAMBDA_NAME }} | |
| package-type: Zip | |
| runtime: python3.14 | |
| handler: handler.handler | |
| publish: false | |
| code-artifacts-dir: ${{ github.workspace }}/package |