chore: update GitHub Actions workflow to set environment variables, e… #75
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 of workflow | |
| name: Production workflow | |
| # When workflow is triggered | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| env: | |
| NODE_OPTIONS: --max-old-space-size=32768 | |
| STORE_PATH: ~/.pnpm-store | |
| # Jobs to carry out | |
| jobs: | |
| deploy: | |
| # Operating system to run job on | |
| runs-on: ubuntu-latest | |
| environment: production | |
| # Steps in job | |
| steps: | |
| # Get code from repo | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| # Check project version | |
| - name: Extract version | |
| id: extract_version | |
| uses: Saionaro/extract-package-version@v1.1.1 | |
| - name: Print version | |
| run: echo ${{ steps.extract_version.outputs.version }} | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| run_install: false | |
| # Install NodeJS | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22.x | |
| cache: 'pnpm' | |
| - uses: actions/cache@v4 | |
| name: Setup pnpm cache | |
| with: | |
| path: ${{ env.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install and build | |
| run: | | |
| pnpm install --frozen-lockfile | |
| pnpm build | |
| env: | |
| APP_ENV: production | |
| APP_CHAIN_ID: 1 | |
| APP_NETWORK_URL: https://mainnet.infura.io/v3/c631883a8bc84ac19b69680df4cfd6b4 | |
| APP_BSC_NETWORK_URL: https://bsc-dataseed1.ninicoin.io | |
| APP_FANTOM_NETWORK_URL: https://rpc.ankr.com/fantom | |
| APP_POLYGON_NETWORK_URL: https://rpc.ankr.com/polygon | |
| APP_UAUTH_CLIENT_ID: aa78dc8b-de48-4754-a1b9-52aa5a44c9b7 | |
| APP_PROJECT_GALAXY_ENDPOINT: https://graphigo.prd.galaxy.eco/query | |
| APP_WALLETCONNECT_PROJECT_ID: 20a23f0fe6fae2e96f807c475d075c04 | |
| # Deploy to Netlify using our production secrets | |
| - name: Deploy to netlify | |
| id: netlify | |
| uses: qbtf/action-netlify-cli@v2 | |
| env: | |
| NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
| NETLIFY_SITE_ID: e3335be6-9531-4bd6-b1dc-302013899981 | |
| with: | |
| args: deploy --dir=dist --prod |