Clean up backend docs and add docs directory #87
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 Backend to AWS Lambda | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths: | |
| - 'backend/**' | |
| - '.github/workflows/backend-deploy.yml' | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.24' | |
| cache-dependency-path: backend/go.sum | |
| - name: Setup AWS SAM CLI | |
| uses: aws-actions/setup-sam@v2 | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| aws-region: us-east-1 | |
| - name: Expire old SAM artifacts (keep S3 costs at zero) | |
| run: | | |
| BUCKET=$(aws cloudformation describe-stack-resource \ | |
| --stack-name aws-sam-cli-managed-default \ | |
| --logical-resource-id SamCliSourceBucket \ | |
| --query 'StackResourceDetail.PhysicalResourceId' \ | |
| --output text 2>/dev/null || true) | |
| if [ -n "$BUCKET" ]; then | |
| aws s3api put-bucket-lifecycle-configuration \ | |
| --bucket "$BUCKET" \ | |
| --lifecycle-configuration '{ | |
| "Rules": [{ | |
| "ID": "expire-sam-artifacts", | |
| "Status": "Enabled", | |
| "Filter": {"Prefix": ""}, | |
| "Expiration": {"Days": 3}, | |
| "NoncurrentVersionExpiration": {"NoncurrentDays": 1} | |
| }] | |
| }' | |
| fi | |
| - name: Build and Package | |
| working-directory: backend | |
| run: | | |
| sam build | |
| - name: Deploy to AWS (No VPC) | |
| working-directory: backend | |
| run: | | |
| sam deploy --no-confirm-changeset --no-fail-on-empty-changeset \ | |
| --stack-name rootaccess-backend \ | |
| --region us-east-1 \ | |
| --capabilities CAPABILITY_IAM \ | |
| --parameter-overrides "Environment=production SSMParameterPath=/RootAccess/Backend LambdaMemorySize=512" \ | |
| --resolve-s3 | |