Last active
December 11, 2024 13:30
-
-
Save bkspace/40c4ea60cdca6a8479365b9f993d9d23 to your computer and use it in GitHub Desktop.
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
cargo build --target wasm32-wasip1 --release | |
wasm-opt -Oz --output $1 $1 --enable-bulk-memory |
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: Deploy | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
changes: | |
name: Change Detection | |
runs-on: ubuntu-latest | |
outputs: | |
admin: ${{ steps.filter.outputs.admin }} | |
extensions: ${{ steps.filter.outputs.extensions }} | |
config: ${{ steps.filter.outputs.config }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dorny/paths-filter@v2 | |
id: filter | |
with: | |
filters: | | |
admin: | |
- 'packages/admin/**' | |
extensions: | |
- 'extensions/**' | |
config: | |
- 'shopify.app.next.toml' | |
shopify: | |
name: Deploy Shopify config and functions | |
runs-on: ubuntu-latest | |
needs: changes | |
if: ${{ needs.changes.outputs.extensions == 'true' || needs.changes.outputs.config == 'true' }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- uses: actions-rust-lang/setup-rust-toolchain@v | |
with: | |
toolchain: stable | |
target: wasm32-wasip1 | |
cache-workspaces: | | |
extensions/function_2 | |
extensions/function_1 | |
- run: cargo install wasm-opt | |
- run: npm install | |
- run: npm run deploy -- --config=shopify.app.next.toml --force | |
env: | |
SHOPIFY_CLI_PARTNERS_TOKEN: ${{ secrets.SHOPIFY_CLI_AUTH_TOKEN }} |
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
api_version = "2024-07" | |
[[extensions]] | |
handle = "my_fun" | |
name = "t:name" | |
description = "t:description" | |
type = "function" | |
[[extensions.targeting]] | |
target = "purchase.product-discount.run" | |
input_query = "src/run.graphql" | |
export = "run" | |
[extensions.build] | |
command = "sh ../../build-wasi.sh ./target/wasm32-wasip1/release/my_fun.wasm" | |
path = "target/wasm32-wasip1/release/my_fun.wasm" | |
watch = [ "src/**/*.rs" ] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment