fix: 💚 add build step #3
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: Deploy Backend | |
on: | |
pull_request: | |
types: [closed] | |
push: | |
branches: | |
- main | |
jobs: | |
deploy-backend: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
# Configuramos Go | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: '1.21' | |
# Instalamos las dependencias | |
- name: Install Dependencies | |
run: go mod tidy | |
# Pasos para el deploy en Railway | |
- name: Install Railway | |
run: bash <(curl -fsSL cli.new) | |
- name: Build the Go app | |
run: | | |
cd cmd/server | |
go build -v -o api | |
- name: Deploy to Railway | |
run: railway up --service ${{ secrets.RAILWAY_SERVICE }} | |
env: | |
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }} |