diff --git a/.github/workflows/publish-orders.yml b/.github/workflows/publish-orders.yml new file mode 100644 index 00000000..f598d801 --- /dev/null +++ b/.github/workflows/publish-orders.yml @@ -0,0 +1,55 @@ +name: publish-orders + +on: + workflow_dispatch: + inputs: + environment: + description: 'Target environment' + required: true + type: choice + options: + # dev environments + - bellecour-dev + - arbitrum-sepolia-dev + # prod environments + - bellecour-prod + - arbitrum-sepolia-prod + - arbitrum-prod + app_address: + description: 'App address to publish orders for' + required: true + type: string + +jobs: + publish-order: + runs-on: ubuntu-latest + environment: ${{ inputs.environment }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20.19.0' + cache: 'npm' + + - name: Install dependencies + working-directory: deployment-dapp + run: npm ci + + # TODO: Migrate to a github workflow using vars instead of app-address files + - name: Create app address file + working-directory: deployment-dapp + run: echo "${{ github.event.inputs.app_address }}" > .app-address + + + # TODO: Check WEB3MAIL_APP_OWNER_PRIVATEKEY is the owner of the app address set as input + - name: Execute order action + working-directory: deployment-dapp + env: + WALLET_PRIVATE_KEY: ${{ secrets.WEB3MAIL_APP_OWNER_PRIVATEKEY }} + PRICE: ${{ vars.SELL_ORDER_PRICE }} + VOLUME: ${{ vars.SELL_ORDER_VOLUME }} + RPC_URL: ${{ secrets.RPC_URL }} + run: npm run publish-sell-order