Skip to content

Merge pull request #433 from qubic/feat/contract-decoding #515

Merge pull request #433 from qubic/feat/contract-decoding

Merge pull request #433 from qubic/feat/contract-decoding #515

Workflow file for this run

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