Skip to content

Merge pull request #20 from oraichain/hotfix/trigger-take-profit #61

Merge pull request #20 from oraichain/hotfix/trigger-take-profit

Merge pull request #20 from oraichain/hotfix/trigger-take-profit #61

name: publish_package
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [main]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains 1 jobs called"build"
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ["18"]
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
# if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn
- name: Build
run: yarn build
- name: Authenticate with private NPM package
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
git config --global user.email "[email protected]"
git config --global user.name "oraichain_official"
- name: Publish oraimargin contracts sdk
id: publish-oraimargin-contracts-sdk
continue-on-error: true
run: yarn deploy packages/contracts-sdk
env:
CI: false
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish oraimargin contracts build
id: publish-oraimargin-contracts-build
continue-on-error: true
run: yarn deploy packages/contracts-build
env:
CI: false
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish vamm price
id: publish-vamm-price
continue-on-error: true
run: yarn deploy packages/vamm_price
env:
CI: false
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Install latest version
id: install
if: steps.publish.outcome != 'failure'
continue-on-error: true
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.GIT_PAT }}
repository: oraichain/infra
event-type: install-package
client-payload: '{"libname": "oraidex-future-vamm-price", "node_version": "18"}'
- name: send result via discord
uses: appleboy/discord-action@master
with:
webhook_id: ${{ secrets.WEBHOOK_ID }}
webhook_token: ${{ secrets.WEBHOOK_TOKEN }}
username: "GitBot"
message: "Deployed ${{ github.event.repository.name }}. result: ${{ steps.publish.outcome }}"
# message: "Deployed ${{ github.event.repository.name }}. result: ${{ steps.publish.outcome }}."