Skip to content

refactor: remove backend proxy, use direct sprite downloads with CORS #238

refactor: remove backend proxy, use direct sprite downloads with CORS

refactor: remove backend proxy, use direct sprite downloads with CORS #238

Workflow file for this run

name: Staging
on:
push:
branches: [test]
concurrency:
group: ${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
permissions:
id-token: write
contents: read
defaults:
run:
shell: bash
jobs:
python-test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: openforge
POSTGRES_PASSWORD: openforge
POSTGRES_DB: openforge_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install -e .
- name: Run tests
env:
PGHOST: localhost
PGUSER: openforge
PGPASSWORD: openforge
PGDATABASE: openforge_test
PGPORT: 5432
run: |
pytest tests/ --cov=openforge
react-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version: '22'
- name: Install dependencies
run: npm install
- name: Run React tests
run: npm test
js-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version: '22'
- name: Install dependencies
run: npm install
- name: Run linting and type checking
run: npm run lint:all
python-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: Install ruff
run: |
python -m pip install --upgrade pip
pip install ruff==0.8.6
- name: Run ruff linting
run: ruff check .
- name: Run ruff formatting check
run: ruff format --check .
docker-build:
name: Staging Docker Build
needs: [python-test, react-test, js-lint, python-lint]
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v5
- name: Set up Docker Context for Buildx
run: |
docker context create builders
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
endpoint: builders
- name: Configure Staging OIDC
uses: aws-actions/configure-aws-credentials@v5
with:
role-to-assume: ${{ vars.ECR_IAM_STAGING }}
role-session-name: staging-ecr
aws-region: us-east-1
- name: Login to ECR
uses: aws-actions/amazon-ecr-login@v2
id: login-com-test-ecr
with:
mask-password: true
- name: Docker Build and Push
id: docker-build
if: ${{ ! inputs.use_cache }}
uses: docker/build-push-action@v6
with:
context: ./
file: ./Dockerfile.api.deploy
push: true
platforms: linux/amd64
provenance: false
tags: "682033461796.dkr.ecr.us-east-1.amazonaws.com/openforge_catalog/api:${{ github.sha }}"
frontend-deploy:
name: Staging Frontend Deploy
needs: docker-build
if: ${{ needs.docker-build.result == 'success' }}
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '20'
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Install dependencies
run: pnpm install
- name: Build frontend
run: pnpm run build
- name: Configure Staging S3 Credentials
uses: aws-actions/configure-aws-credentials@v5
with:
role-to-assume: ${{ vars.ECR_IAM_STAGING }}
role-session-name: staging-s3
aws-region: us-east-1
- name: Deploy to S3
run: |
cd out
aws s3 sync . s3://staging-openforge-catalog-website/${{ github.sha }}
echo "Deployed to staging at SHA: ${{ github.sha }}"