From a3b2572adbdbd9f7611f0ef0b4f7b7c0880576e0 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Thu, 31 Oct 2024 21:48:06 +0330 Subject: [PATCH] use autobuild for deploy --- .github/workflows/deploy.yaml | 42 ++++++++--------------------------- package.json | 2 +- wasmer.toml | 2 +- 3 files changed, 11 insertions(+), 35 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index c79c8cd..6aff907 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -14,41 +14,17 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Install Rust - uses: actions/checkout@v3 - with: - toolchain: stable - - - name: Setup Wasmer - uses: wasmerio/setup-wasmer@v2 - - - name: Install pnpm - uses: pnpm/action-setup@v2 - id: pnpm-install - with: - version: 8 - run_install: false - - - name: Get pnpm store directory - id: pnpm-cache - shell: bash + - name: Install Tools run: | - echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT + sudo apt-get install -y docker-ce docker-ce-cli containerd.io curl tar jq - - uses: actions/cache@v3 - name: Setup pnpm cache - with: - path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- - - - name: Install dependencies - run: pnpm install - - - name: Build - run: pnpm run build + - name: Setup autobuild + run: | + ASSET_URL=$(curl -s -H "Authorization: token ${{ secrets.AUTOBUILD_TOKEN }}" https://api.github.com/repos/wasmerio/autobuild/releases/latest | jq '.assets[0].url') + curl -L --output autobuild.tar.gz -H "Accept: application/octet-stream" -H "Authorization: token ${{ secrets.AUTOBUILD_TOKEN }}" $ASSET_URL + tar -xzvf autobuild.tar.gz + chmod +x autobuild # Publish to wasix.org - name: Publish - run: wasmer deploy --non-interactive --registry https://registry.wasmer.io/graphql --token=${{ secrets.WASMER_CIUSER_PROD_TOKEN }} + run: ./autobuild build --wasmer-token ${{ secrets.WASMER_CIUSER_PROD_TOKEN }} --owner wasmer --not-depot --dont-deploy-in-docker-build . diff --git a/package.json b/package.json index aaa4e09..2c5829a 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Nextra docs template", "scripts": { "dev": "next dev", - "build": "next build && next export -o release", + "build": "next build && next export -o out", "start": "next start" }, "repository": { diff --git a/wasmer.toml b/wasmer.toml index e9cfec1..1678abf 100644 --- a/wasmer.toml +++ b/wasmer.toml @@ -2,4 +2,4 @@ "sharrattj/static-web-server" = "^1" [fs] -public = "release" +public = "out"