Trigger CI #40
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: Build & Deploy | |
| on: | |
| push: | |
| branches: [ master ] | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: actions/setup-node@v1 | |
| with: | |
| node-version: 14 | |
| - name: Configure Host | |
| run: | | |
| mkdir -p ~/.ssh | |
| echo "$SSH_KEY" >> ~/.ssh/github-ci | |
| chmod 400 ~/.ssh/github-ci | |
| echo "$DEPLOY_KEY" >> ~/.ssh/deploy_key | |
| chmod 400 ~/.ssh/deploy_key | |
| echo -e "Host github-ci | |
| \tUser github-ci | |
| \tHostName 64.227.111.66 | |
| \tIdentityFile ~/.ssh/github-ci | |
| \tForwardAgent yes | |
| \tStrictHostKeyChecking No" >> ~/.ssh/config | |
| chmod 400 ~/.ssh/config | |
| shell: bash | |
| env: | |
| SSH_KEY: ${{secrets.SSH_KEY}} | |
| DEPLOY_KEY: ${{secrets.DEPLOY_KEY}} | |
| - name: Start SSH Agent | |
| run: | | |
| eval "$(ssh-agent -s)" | |
| ssh-add ~/.ssh/deploy_key | |
| shell: bash | |
| - name: Install PM2 | |
| run: npm install -g pm2 | |
| - name: Create env file | |
| run: | | |
| touch .env | |
| echo "JSON_RPC_URL_1=\"$JSON_RPC_URL_1\" | |
| JSON_RPC_URL_56=\"$JSON_RPC_URL_56\" | |
| JSON_RPC_URL_42161=\"$JSON_RPC_URL_42161\"" >> .env | |
| shell: bash | |
| env: | |
| JSON_RPC_URL_1: ${{ secrets.JSON_RPC_URL_1 }} | |
| JSON_RPC_URL_56: ${{ secrets.JSON_RPC_URL_56 }} | |
| JSON_RPC_URL_42161: ${{ secrets.JSON_RPC_URL_42161 }} | |
| - name: Deploy | |
| run: pm2 deploy pm2.json production |