Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use autobuild for deploy #80

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 9 additions & 33 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion wasmer.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"sharrattj/static-web-server" = "^1"

[fs]
public = "release"
public = "out"