Merge pull request #433 from qubic/feat/contract-decoding #515
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: π Release and Deploy | |
| on: | |
| push: | |
| branches: | |
| - dev | |
| - staging | |
| - main | |
| - testnet | |
| pull_request: | |
| types: | |
| - closed | |
| branches: | |
| - dev | |
| - staging | |
| - main | |
| - testnet | |
| jobs: | |
| release-and-deploy: | |
| runs-on: ubuntu-latest | |
| # Only run on push events OR on merged pull requests (not closed-without-merge) | |
| if: github.event_name == 'push' || github.event.pull_request.merged == true | |
| steps: | |
| - name: ποΈ Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Fetch full commit history | |
| - name: βοΈ Setup pnpm | |
| uses: pnpm/action-setup@v4.0.0 | |
| - name: π§ Set up Node.js 20.x | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: 'pnpm' | |
| registry-url: 'https://npm.pkg.github.com' | |
| - name: π¦ Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: π Run Semantic Release | |
| run: pnpm run release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/staging' | |
| - name: ποΈ Build app | |
| env: | |
| VITE_NETWORK: ${{ github.ref == 'refs/heads/testnet' && 'testnet' || 'mainnet' }} | |
| VITE_QLI_API_URL: ${{ secrets.QLI_API_URL }} | |
| VITE_QUBIC_RPC_URL: ${{ github.ref == 'refs/heads/testnet' && secrets.QUBIC_RPC_URL_TESTNET || secrets.QUBIC_RPC_URL }} | |
| VITE_STATIC_API_URL: | | |
| ${{ | |
| (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/testnet') && secrets.STATIC_API_URL || | |
| github.ref == 'refs/heads/staging' && secrets.STATIC_API_URL_STAGING || | |
| secrets.STATIC_API_URL_DEV | |
| }} | |
| run: pnpm run build | |
| - name: π€ Deploy to the corresponding environment | |
| uses: SamKirkland/FTP-Deploy-Action@4.3.3 | |
| with: | |
| server: ${{ secrets.FTP_SERVER }} | |
| username: | | |
| ${{ | |
| github.ref == 'refs/heads/main' && secrets.FTP_USERNAME_PROD || | |
| github.ref == 'refs/heads/testnet' && secrets.FTP_USERNAME_TESTNET || | |
| github.ref == 'refs/heads/staging' && secrets.FTP_USERNAME_STAGING || | |
| secrets.FTP_USERNAME_DEV | |
| }} | |
| password: | | |
| ${{ | |
| github.ref == 'refs/heads/main' && secrets.FTP_PASSWORD_PROD || | |
| github.ref == 'refs/heads/testnet' && secrets.FTP_PASSWORD_TESTNET || | |
| github.ref == 'refs/heads/staging' && secrets.FTP_PASSWORD_STAGING || | |
| secrets.FTP_PASSWORD_DEV | |
| }} | |
| local-dir: dist/ | |
| protocol: ftps |