Skip to content

Commit

Permalink
modified: .github/workflows/action.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jeiksegovia committed Dec 28, 2022
1 parent c0723a7 commit 685ec96
Showing 1 changed file with 32 additions and 12 deletions.
44 changes: 32 additions & 12 deletions .github/workflows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
run: |
echo "starting linting"
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
build:
needs: lint
Expand Down Expand Up @@ -86,8 +86,7 @@ jobs:
uses: actions/download-artifact@v2
with:
name: zipped-bundle
- &id001
name: Configure AWS credentials
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
Expand All @@ -98,17 +97,38 @@ jobs:
echo "${{ github.ref }}"
aws s3 cp ${{ github.sha }}.zip s3://jk-github-action-test/
test:
runs-on: ubuntu-latest
needs: upload
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACESS_KEY }}
aws-region: us-east-1
- name: Create test function
run: |
aws lambda create-function --function-name jk_github_action_manual_lambda_test_1-test-function \
--code S3Bucket=jk-github-action-test,S3Key=${{ github.sha }}.zip \
--handler lambda_function.lambda_handler --runtime python3.8 \
--role arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/jk_github_actions_lambda_test
- name: Wait 30 seconds
run: sleep 30
- name: Destroy test function
if: ${{ always() }}
run: aws lambda delete-function --function-name jk_github_action_manual_lambda_test_1-test-function

deploy:
runs-on: ubuntu-latest
needs: upload
steps:
- *id001
# - name: Configure AWS credentials
# uses: aws-actions/configure-aws-credentials@v1
# with:
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACESS_KEY }}
# aws-region: us-east-1
needs: test
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACESS_KEY }}
aws-region: us-east-1
- name: Update function code
run: |
echo "${{ github.ref }}"
Expand Down

0 comments on commit 685ec96

Please sign in to comment.