KyberSwap Pre-Release Publish #190
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: "KyberSwap Pre-Release Publish" | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| SERVICE: kyberswap-interface | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - run: | | |
| echo "@kybernetwork:registry=https://npm.pkg.github.com" >> .npmrc | |
| echo "//npm.pkg.github.com/:_authToken=${{ secrets.GH_PAT }}" >> .npmrc | |
| echo "sha_short=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV" | |
| echo "VITE_TAG=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV" | |
| - uses: pnpm/action-setup@v4 | |
| name: Install pnpm | |
| with: | |
| version: 8.9.2 | |
| run_install: false | |
| - name: Set up Node.js | |
| uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0 | |
| with: | |
| node-version: 21.0.0 | |
| registry-url: "https://npm.pkg.github.com" | |
| scope: "@kybernetwork" | |
| token: ${{ secrets.GH_PAT }} | |
| cache: "pnpm" | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Build packages | |
| run: | | |
| pnpm build-package | |
| - name: Run lint | |
| run: pnpm lint && pnpm type-check | |
| - name: Build interface | |
| env: | |
| CI: false | |
| NODE_OPTIONS: "--max_old_space_size=4096" | |
| working-directory: apps/kyberswap-interface | |
| run: pnpm build-prod | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@master | |
| - name: Gcloud Auth | |
| uses: google-github-actions/auth@v1 | |
| with: | |
| credentials_json: "${{ secrets.GCR_CREDENTIALS }}" | |
| - name: Setup Gcloud SDK | |
| uses: google-github-actions/setup-gcloud@v1 | |
| - name: Configure docker | |
| run: gcloud auth configure-docker | |
| - name: Cache Docker layers | |
| uses: actions/cache@v4 | |
| with: | |
| path: /tmp/.buildx-cache | |
| key: ${{ runner.os }}-${{ env.SERVICE }}-buildx | |
| - name: Build and push | |
| uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 #v6.13.0 | |
| with: | |
| context: apps/kyberswap-interface | |
| push: true | |
| labels: | | |
| kyber.network.schema-version=1.0 | |
| kyber.network.vcs-ref=${{ github.sha }} | |
| kyber.network.version=pre-${{ env.sha_short }} | |
| kyber.network.name=${{ env.SERVICE }} | |
| tags: asia.gcr.io/kyber-operation/core/${{ env.SERVICE }}:pre-${{ env.sha_short }} | |
| cache-from: type=local,src=/tmp/.buildx-cache | |
| cache-to: type=local,dest=/tmp/.buildx-cache-new | |
| - name: Move Docker cache | |
| run: | | |
| rm -rf /tmp/.buildx-cache | |
| mv /tmp/.buildx-cache-new /tmp/.buildx-cache |