Skip to content

Only trigger GitHub actions if relevant files change #25

Only trigger GitHub actions if relevant files change

Only trigger GitHub actions if relevant files change #25

Workflow file for this run

name: Backend - Build & Deploy
on:
push:
branches: [ "main" ]
paths: "server/**"
pull_request:
branches: [ "main" ]
paths: "server/**"
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20'
- name: Install dependencies
working-directory: ./server
run: yarn install --frozen-lockfile
- name: Build server
working-directory: ./server
run: yarn build
- uses: a7ul/tar-action@v1.1.0
with:
command: c
cwd: "./"
files: |
server/
outPath: deploy.tar
- name: Deploy App to CapRover
uses: caprover/deploy-from-github@v1.0.1
with:
server: '${{ secrets.CAPROVER_SERVER }}'
app: '${{ secrets.APP_NAME }}'
token: '${{ secrets.APP_TOKEN }}'