Skip to content

Instantly share code, notes, and snippets.

@pipethedev
Created October 12, 2023 16:27
Show Gist options
  • Save pipethedev/9280c2bbb70c3f1bea9f703cce59fee1 to your computer and use it in GitHub Desktop.
Save pipethedev/9280c2bbb70c3f1bea9f703cce59fee1 to your computer and use it in GitHub Desktop.
deploy on multiple servers
name: Brimble Runner Deployment
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:
jobs:
deploy:
name: Deploy to Server
runs-on: ubuntu-latest
strategy:
matrix:
server: [s1.brimble.io, s2.brimble.io, pr.brimble.io]
steps:
- name: Git Pull on Server
uses: appleboy/ssh-action@master
with:
host: ${{ matrix.server }}
username: ${{ secrets.BRIMBLE_USER }}
key: ${{ secrets.BRIMBLE_KEY }}
script: |
cd /brimble/runner
git reset --hard && git pull
export NVM_DIR=~/.nvm
source ~/.nvm/nvm.sh
yarn && yarn build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment