Update deploy-production.yml #30
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 Staging | |
| on: | |
| push: | |
| branches: [main] | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| environment: staging # add env-level secrets if desired | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| - run: npm ci | |
| - run: npx expo export --platform web --output-dir dist-web | |
| - name: Build backend container | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: backend | |
| push: true | |
| tags: ghcr.io/${{ github.repository }}:staging | |
| # Example: deploy to AWS Elastic Beanstalk | |
| - name: Deploy to EB | |
| uses: einaregilsson/beanstalk-deploy@v25 | |
| with: | |
| application_name: ai-eyes-staging | |
| environment_name: ai-eyes-staging-env | |
| version_label: github-${{ github.sha }} | |
| bucket_name: ${{ secrets.EB_S3_BUCKET }} | |
| bucket_key: app-${{ github.sha }}.zip | |
| region: us-east-1 | |
| deployment_package: backend/Dockerrun.aws.json | |
| aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |