Merge pull request #449 from Macnelson9/main #7
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 Production | |
| on: | |
| push: | |
| branches: [main] | |
| tags: | |
| - 'v*' | |
| jobs: | |
| deploy-frontend: | |
| runs-on: ubuntu-latest | |
| environment: production | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install dependencies | |
| working-directory: ./frontend | |
| run: npm ci | |
| - name: Build for production | |
| working-directory: ./frontend | |
| env: | |
| VITE_NETWORK: mainnet | |
| VITE_FACTORY_CONTRACT_ID: ${{ secrets.MAINNET_CONTRACT_ID }} | |
| VITE_IPFS_API_KEY: ${{ secrets.IPFS_API_KEY }} | |
| VITE_IPFS_API_SECRET: ${{ secrets.IPFS_API_SECRET }} | |
| run: npm run build | |
| - name: Deploy to Vercel Production | |
| uses: amondnet/vercel-action@v25 | |
| with: | |
| vercel-token: ${{ secrets.VERCEL_TOKEN }} | |
| vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} | |
| vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} | |
| working-directory: ./frontend | |
| vercel-args: '--prod' | |
| - name: Create deployment notification | |
| if: success() | |
| run: | | |
| echo "✅ Production deployment successful!" | |
| deploy-contract: | |
| runs-on: ubuntu-latest | |
| environment: production | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| - name: Build optimized contract | |
| working-directory: ./contracts/token-factory | |
| run: cargo build --target wasm32-unknown-unknown --release | |
| - name: Upload optimized WASM | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: mainnet-contract-${{ github.ref_name }} | |
| path: contracts/token-factory/target/wasm32-unknown-unknown/release/*.wasm | |
| retention-days: 90 |