Prevent deployment via GitHub actions
alexkalopsia
TRIALOP

2 years ago

I am trying to have a setup where I DON'T deploy if I am updating specific files on my GH repo. In other words, if I am updating my README.md , I don't wanna redeploy.

My understanding is that to do that I need to use GitHub actions, and to activate Wait for CI. The problem is that the option is only available when the project is connected to a branch, which also automatically triggers the autodeploy.

I then end up with two overlapping deployments (one from GitHub integration, the other from railway up.

I am looking for some guidance, thank you

This is my deploy.yml

---

name: Deploy to Railway

on:

push:

branches:

- master

- dev

paths-ignore:

- '.github/**'

- '.tests/**'

- '.gitignore'

- 'app_config.wsgi'

- 'base-requirements.txt'

- 'deploy.py'

- 'LICENSE'

- 'README.md'

- 'requirements.txt'

jobs:

deploy:

runs-on: ubuntu-latest

steps:

- name: Checkout code

uses: actions/checkout@v2

- name: Set up Python

uses: actions/setup-python@v2

with:

python-version: '3.8'

- name: Install Railway CLI

run: curl -fsSL https://railway.app/install.sh | sh

- name: Deploy to Railway

run: |

if [ "${GITHUB_REF}" == "refs/heads/master" ]; then

RAILWAY_TOKEN="${{ secrets.RAILWAY_TOKEN_PROD }}" railway up --environment production --service myapp

elif [ "${GITHUB_REF}" == "refs/heads/dev" ]; then

RAILWAY_TOKEN="${{ secrets.RAILWAY_TOKEN_DEV }}" railway up --environment dev --service myapp

fi

1 Replies

2 years ago

I'm fairly certain watch paths can achieve what you need -

https://docs.railway.app/guides/build-configuration#configure-watch-paths


Welcome!

Sign in to your Railway account to join the conversation.

Loading...