feat(payment): add handling for failed and cancelled payment notifica… #41
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 DurianPy Events Service | |
| on: | |
| push: | |
| paths: | |
| - backend/** | |
| branches: | |
| - main | |
| - stage | |
| workflow_dispatch: | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Set ARN for Role to Assume | |
| run: | | |
| if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then | |
| echo "AWS_OIDC_ROLE_ARN=${{ secrets.AWS_OIDC_ROLE_ARN_PROD }}" >> $GITHUB_ENV | |
| elif [[ "${{ github.ref }}" == "refs/heads/stage" ]]; then | |
| echo "AWS_OIDC_ROLE_ARN=${{ secrets.AWS_OIDC_ROLE_ARN_STAGE }}" >> $GITHUB_ENV | |
| fi | |
| - name: Configure AWS Credentials | |
| uses: aws-actions/configure-aws-credentials@v4.1.0 | |
| with: | |
| audience: sts.amazonaws.com | |
| aws-region: ap-southeast-1 | |
| role-to-assume: ${{ env.AWS_OIDC_ROLE_ARN }} | |
| role-session-name: GithubActionSession | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version-file: "backend/.python-version" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| - name: Install dependencies | |
| run: | | |
| uv sync --locked --all-extras --dev | |
| working-directory: backend | |
| - name: Install Serverless Framework | |
| run: | | |
| npm install | |
| npm install -g serverless@3.40.0 | |
| working-directory: backend | |
| - name: Create requirements.txt | |
| run: uv export --format requirements-txt --no-hashes --output-file requirements.txt --no-dev | |
| working-directory: backend | |
| - name: Deploy with Serverless v3 | |
| run: | | |
| if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then | |
| sls deploy --stage prod --verbose | |
| elif [[ "${{ github.ref }}" == "refs/heads/stage" ]]; then | |
| sls deploy --stage staging --verbose | |
| fi | |
| working-directory: backend |