refactor(cl) refactor cl operation by introducing OneditService (#1910) #24
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: Orion client deploy | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - ".github/workflows/orion-client-deploy.yml" | |
| - "orion/**" | |
| - "scorpio/**" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| if: ${{ github.repository == 'web3infra-foundation/mega' }} | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| # Rust toolchain | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: release | |
| cache-on-failure: true | |
| - name: Build Orion | |
| run: cargo build --release -p orion --bin orion | |
| - name: Build Scorpio | |
| run: cargo build --release -p scorpio --bin scorpio | |
| - name: Verify build artifacts | |
| run: | | |
| ls -lh target/release || true | |
| file target/release/orion || true | |
| file target/release/scorpio || true | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: orion-scorpio-bins | |
| path: | | |
| target/release/orion | |
| target/release/scorpio | |
| deploy: | |
| if: ${{ github.repository == 'web3infra-foundation/mega' }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: orion-scorpio-bins | |
| path: ./artifacts | |
| - name: Upload binaries via rsync | |
| uses: burnett01/rsync-deployments@master | |
| with: | |
| switches: -avz --progress | |
| path: artifacts/orion artifacts/scorpio | |
| remote_path: /root/orion-runner/ | |
| remote_host: ${{ secrets.ORION_DEPLOY_HOST }} | |
| remote_user: root | |
| remote_key: ${{ secrets.ORION_DEPLOY_SSH_KEY }} | |
| - name: Restart service | |
| uses: appleboy/ssh-action@v1.0.3 | |
| with: | |
| host: ${{ secrets.ORION_DEPLOY_HOST }} | |
| username: root | |
| key: ${{ secrets.ORION_DEPLOY_SSH_KEY }} | |
| script: | | |
| systemctl daemon-reload | |
| systemctl restart orion-runner.service | |
| systemctl status orion-runner.service --no-pager |