Update README.md #11
This file contains 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: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '18' | |
- name: Clear npm cache | |
run: npm cache clean --force | |
- name: Install dependencies | |
run: | | |
sudo apt-get install -y libx11-xcb1 libxcomposite1 libxdamage1 libxext6 libxfixes3 libnss3 libnspr4 libasound2 libatk1.0-0 libatk-bridge2.0-0 libcups2 libxrandr2 libpangocairo-1.0-0 libgtk-3-0 | |
npm ci | |
- name: Install ngrok | |
run: npm install ngrok -g | |
- name: Configure ngrok | |
run: ngrok config add-authtoken ${{ secrets.NGROK_AUTH_TOKEN }} | |
- name: Start server & ngrok tunnel | |
run: | | |
npm start 8080 & | |
sleep 5 | |
ngrok http 8080 & | |
sleep 5 | |
- name: Get ngrok public URL | |
id: ngrok | |
run: | | |
url=$(curl http://localhost:4040/api/tunnels | jq -r '.tunnels[0].public_url') | |
echo "::set-output name=url::$url" | |
echo $url | |
- name: Print ngrok URL | |
run: echo "The ngrok public URL is ${{ steps.ngrok.outputs.url }}" | |
- name: Keep alive | |
run: sleep 300 | |
- name: Upload npm debug log | |
if: failure() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: npm-debug-log | |
path: /home/runner/.npm/_logs/*-debug.log | |