Skip to content

feat(payment): add handling for failed and cancelled payment notifica… #40

feat(payment): add handling for failed and cancelled payment notifica…

feat(payment): add handling for failed and cancelled payment notifica… #40

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