Deploy to Production #1
Workflow file for this run
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-prod | |
| run-name: Deploy to Production | |
| on: pull_request | |
| env: | |
| AWS_REGION: ${{ vars.AWS_DEFAULT_REGION }} | |
| AWS_ACCOUNT_ID: ${{ vars.AWS_CELLS_ACCOUNT_ID }} | |
| # Permissions required for the workflow to interact with AWS via OIDC | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| deploy-preview: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Add SHORT_SHA env property with commit short sha | |
| run: echo "SHORT_SHA=`echo ${{ github.sha }} | cut -c1-8`" >> $GITHUB_ENV | |
| - name: Configure AWS credentials with OIDC | |
| uses: aws-actions/configure-aws-credentials@00943011d9042930efac3dcd3a170e4273319bc8 | |
| with: | |
| role-to-assume: arn:aws:iam::${{ env.AWS_ACCOUNT_ID }}:role/github_cellpack | |
| role-session-name: github_cellpack-${{ env.SHORT_SHA }} | |
| aws-region: ${{ env.AWS_REGION }} | |
| - name: Set up Bun | |
| uses: oven-sh/setup-bun@v2 | |
| - name: Install | |
| run: bun install | |
| - name: Build with Vite | |
| run: bun run build | |
| - name: Copy files to production bucket | |
| run: aws s3 sync ./dist/ s3://cellpack-results/test/test-gh-action/ --delete |