fix: Correct package name from py-rpds to rpds-py #4
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 to AWS CloudFormation | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - deploy | |
| env: | |
| AWS_REGION: ap-northeast-1 | |
| PROJECT_NAME: LambdaFramework | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Validate SAM template | |
| run: | | |
| sam validate | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| role-to-assume: ${{ github.ref == 'refs/heads/main' && secrets.AWS_ROLE_ARN_PROD || secrets.AWS_ROLE_ARN_DEV }} | |
| aws-region: ${{ env.AWS_REGION }} | |
| - name: Deploy with SAM | |
| run: | | |
| # ブランチに基づいて環境設定を決定 | |
| if [ "${{ github.ref }}" = "refs/heads/main" ]; then | |
| STACK_NAME="lambda-framework-prod" | |
| ENVIRONMENT="production" | |
| else | |
| STACK_NAME="lambda-framework-dev" | |
| ENVIRONMENT="development" | |
| fi | |
| echo "Deploying to environment: $ENVIRONMENT" | |
| echo "Stack name: $STACK_NAME" | |
| sam build | |
| sam deploy --no-confirm-changeset --no-fail-on-empty-changeset \ | |
| --stack-name $STACK_NAME \ | |
| --s3-bucket cn-seba-aws-sam-cli-managed-default-samclisourcebucket \ | |
| --parameter-overrides ProjectName=${{ env.PROJECT_NAME }} Environment=$ENVIRONMENT | |
| env: | |
| SAM_CLI_TELEMETRY: 0 | |
| - name: Deploy status | |
| if: always() | |
| run: | | |
| # ブランチに基づいて環境設定を決定 | |
| if [ "${{ github.ref }}" = "refs/heads/main" ]; then | |
| STACK_NAME="lambda-framework-prod" | |
| ENVIRONMENT="production" | |
| else | |
| STACK_NAME="lambda-framework-dev" | |
| ENVIRONMENT="development" | |
| fi | |
| echo "Deployment completed for branch: ${{ github.ref }}" | |
| echo "Stack name: $STACK_NAME" | |
| echo "Environment: $ENVIRONMENT" | |
| echo "Commit: ${{ github.sha }}" |