R
Railway7mo ago
Chhabi

Error on GitHub Actions. Flask app has been deployed successfully.

When I try to automate the deployment process through github actions, I get the same error. Here's the yml file:
name: Deploy to Railway

on:
push:
branches: [main]

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.9'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Railway Deploy
uses: bervProject/railway-deploy@main
with:
railway_token: ${{ secrets.RAILWAY_TOKEN }}
service: "my-service"
detach: true
name: Deploy to Railway

on:
push:
branches: [main]

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.9'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Railway Deploy
uses: bervProject/railway-deploy@main
with:
railway_token: ${{ secrets.RAILWAY_TOKEN }}
service: "my-service"
detach: true
No description
29 Replies
Percy
Percy7mo ago
Project ID: 4cd190fb-44e4-4599-af46-2de405c0bce2
Chhabi
ChhabiOP7mo ago
4cd190fb-44e4-4599-af46-2de405c0bce2
Brody
Brody7mo ago
may I ask why you are installing python and your apps deps in the action?
Chhabi
ChhabiOP7mo ago
I don't know. I am new to this. I got this solution from gpt. Can you please guide me?
Brody
Brody7mo ago
what is the purpose of using a GitHub action in the first place?
Chhabi
ChhabiOP7mo ago
continuous integration/ continuous deployment.
Brody
Brody7mo ago
did you just give me a chatgpt answer to my question?
Chhabi
ChhabiOP7mo ago
nope.
Brody
Brody7mo ago
okay then please answer the question properly
Chhabi
ChhabiOP7mo ago
let me explain what I understood properly. Say we have a project in GitHub, say at each push, we want to lint, test, build, and finally deploy if everything goes right in one single push.
Brody
Brody7mo ago
I know what you can do with GitHub actions, I'm asking what purpose it has for you, why not just set your repo to your source in the service settings?
Chhabi
ChhabiOP7mo ago
sorry, i didn't understand. Does the update happens automatically in Railway after I change something in main branch of github?
Brody
Brody7mo ago
yes that's exactly how railway works
Chhabi
ChhabiOP7mo ago
oh I see.
Brody
Brody7mo ago
there's no need for a GitHub action to achieve that functionality
Chhabi
ChhabiOP7mo ago
well, now I understand. If we were to do it in other platforms like AWS, AZURE... do we need to set up YML file? I am sorry, but I am a novice to all these stuffs.
Brody
Brody7mo ago
what does aws or azure have to do with railway?
Chhabi
ChhabiOP7mo ago
I mean I was learning how to deploy Flask app on AWS EC2 instance the other day. I was trying to automate through github actions similarly. I got bunch of errors, so I quit. Thank you for the clarification.@Brody
Brody
Brody7mo ago
use your repo as a source and let me know if you run into further issues
Chhabi
ChhabiOP7mo ago
let me clear one more thing for now, do I not need.github/workflow/deploy.yml file in my repo? Also, if I deploy my project in RAILWAY through GitHub repo (source), from where does the ci/cd automation carry out?
Brody
Brody7mo ago
you do not need a workflow action for a simple railway deploy, but having it is not going to affect anything. there will be no ci/cd ran, only your app will be ran
Chhabi
ChhabiOP7mo ago
It means I have to push the correct code in github repo everytime otherwise the deployment may get an error? right?
Brody
Brody7mo ago
as long as you implement a readiness health check, railway won't push a build out if it fails building or the health check
Chhabi
ChhabiOP7mo ago
got it. Thank you ❤️
Brody
Brody7mo ago
no problem!
Chhabi
ChhabiOP7mo ago
just had an idea, can you clarify? i.e. to add yml file to lint and test for each push in github. Only after successful test, it is push to github main, after which gets automatically deployed in RAILWAY.
No description
Chhabi
ChhabiOP7mo ago
@Brody
Brody
Brody7mo ago
please don't ping, it's against the server rules but I'm sorry, I'm not going to help with AI generated answers, please watch some YouTube videos and read some articles written by humans who know what they're talking about
Chhabi
ChhabiOP7mo ago
well, yes. that's a nice idea.
Want results from more Discord servers?
Add your server