Skip to content

Commit

Permalink
chore: update github action
Browse files Browse the repository at this point in the history
  • Loading branch information
linkdesu committed Jan 31, 2024
1 parent cbd73d7 commit 6310e29
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 112 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/build-and-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Build and deploy

on:
push:
branches: [main, develop]
workflow_dispatch:

jobs:
build:
runs-on: sg
steps:
- run: echo Hello ${{ github.ref }}.
# - name: Checkout repository
# uses: actions/checkout@v3
# with:
# ref: ${{ github.ref }}

# - name: Setup Node.js environment
# uses: actions/setup-node@v3
# with:
# node-version: 18.x

# - name: Restore Cache
# id: cache-node_modules
# uses: actions/cache@v3
# with:
# path: node_modules
# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.yaml') }}

# - name: Install dependency
# run: npm install

# - name: List the state of node modules
# if: ${{ steps.cache-node_modules.outputs.cache-hit != 'true' }}
# continue-on-error: true
# run: npm list

# - name: Build
# run: npm run build

# - name: Archive file
# uses: TheDoctor0/[email protected]
# with:
# filename: thq-${{ github.sha }}.zip
# exclusions: '/*node_modules/*'

# - name: Archive production artifacts
# uses: actions/upload-artifact@v3
# with:
# name: thq-${{ github.sha }}.zip
# path: ./thq-${{ github.sha }}.zip

deploy-to-testnet:
runs-on: sg
if: ${{ github.event.workflow_run.conclusion == 'success' && github.ref_name == 'develop' }}
environment: testnet
strategy:
matrix:
target: [SERVER_1, SERVER_2]
steps:
- run: echo Hello ${{ github.ref }}.
# - name: Download Artifact
# uses: actions/download-artifact@v3
# with:
# name: thq-${{ github.sha }}.zip

# - name: Unzip artifact
# run: rm -rf ./dist && unzip -q thq-${{ github.sha }}.zip -d ./dist

# - name: Deploy to server contract
# run: ls -la ./dist && rsync -a ./dist/ ${{ vars[matrix.target] }}:/mnt/ckb/ckb-time-generator

# - name: Restart pm2 on server contract
# run: ssh ${{ vars[matrix.target] }} 'source ~/.zshrc && cd /mnt/ckb/ckb-time-generator && npm install --omit=dev && npm run reload_testnet'


63 changes: 0 additions & 63 deletions .github/workflows/cd.yaml

This file was deleted.

49 changes: 0 additions & 49 deletions .github/workflows/ci.yaml

This file was deleted.

0 comments on commit 6310e29

Please sign in to comment.