This file contains 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 Walrus Site using Walrus Sites GA | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Check if Clip has changed | |
id: clip_changed | |
run: | | |
if git diff --quiet HEAD^ HEAD -- packages/clip; then | |
echo "clip_changed=false" >> $GITHUB_ENV | |
else | |
echo "clip_changed=true" >> $GITHUB_ENV | |
fi | |
- name: Check if Demo has changed | |
id: demo_changed | |
run: | | |
if git diff --quiet HEAD^ HEAD -- packages/demo; then | |
echo "demo_changed=false" >> $GITHUB_ENV | |
else | |
echo "demo_changed=true" >> $GITHUB_ENV | |
fi | |
- name: Copy Clip package to temporary directory | |
if: env.clip_changed == 'true' | |
run: | | |
mkdir -p /tmp/clip | |
cp -r ./packages/clip/* /tmp/clip/ | |
- name: Install dependencies and Build Clip | |
if: env.clip_changed == 'true' | |
env: | |
VITE_APP_CLIENT_ID: ${{ secrets.VITE_APP_CLIENT_ID }} | |
VITE_APP_ENOKI_KEY: ${{ secrets.VITE_APP_ENOKI_KEY }} | |
VITE_APP_SPONSORED_URL: ${{ secrets.VITE_APP_SPONSORED_URL }} | |
run: | | |
cd /tmp/clip | |
npm install | |
npm run build | |
- name: Deploy Clip to Walrus | |
if: env.clip_changed == 'true' | |
uses: zktx-io/[email protected] | |
with: | |
site-path: '/tmp/clip/dist' | |
object-id: '0xe15bc83bb0ae8d32188611fcc38d9068adc9530390e3b5f157a5dbdcb219378f' | |
network: 'testnet' | |
epochs: 180 | |
wal-exchange-enabled: false | |
env: | |
SUI_ADDRESS: ${{ vars.SUI_ADDRESS }} | |
SUI_KEYSTORE: ${{ secrets.SUI_KEYSTORE }} | |
- name: Copy Demo package to temporary directory | |
if: env.demo_changed == 'true' | |
run: | | |
mkdir -p /tmp/demo | |
cp -r ./packages/demo/* /tmp/demo/ | |
- name: Install dependencies and Build Demo | |
if: env.demo_changed == 'true' | |
env: | |
VITE_APP_SPONSORED_URL: ${{ secrets.VITE_APP_SPONSORED_URL }} | |
run: | | |
cd /tmp/demo | |
npm install | |
npm run build | |
- name: Deploy Demo to Walrus | |
if: env.demo_changed == 'true' | |
uses: zktx-io/[email protected] | |
with: | |
site-path: '/tmp/demo/dist' | |
object-id: '0x0d7ed2149c0d99f4021a795b42b7086db9e6949e6636b1f303b60032aeba3bf8' | |
network: 'testnet' | |
epochs: 180 | |
wal-exchange-enabled: false | |
env: | |
SUI_ADDRESS: ${{ vars.SUI_ADDRESS_DEMO }} | |
SUI_KEYSTORE: ${{ secrets.SUI_KEYSTORE_DEMO }} |