Skip to content

Update set-up.yaml

Update set-up.yaml #13

Workflow file for this run

name: CI/CD Pipeline
on:
push:
branches:
- main # o la rama que elijas
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up JDK 21
uses: actions/setup-java@v2
with:
java-version: '21'
distribution: 'adopt'
- name: Create application-secrets.properties
env:
DB_HOST: ${{ secrets.DB_HOST }}
DB_PORT: ${{ secrets.DB_PORT }}
DB_USER: ${{ secrets.DB_USER }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
SENDGRID_API_KEY: ${{ secrets.SENDGRID_API_KEY }}
run: |
echo "spring.datasource.url=jdbc:postgresql://$DB_HOST:$DB_PORT/railway" >> SkyShop/src/main/resources/application-secrets.properties
echo "spring.datasource.username=$DB_USER" >> SkyShop/src/main/resources/application-secrets.properties
echo "spring.datasource.password=$DB_PASSWORD" >> SkyShop/src/main/resources/application-secrets.properties
echo "sendgrid.key = $SENDGRID_API_KEY" >> SkyShop/src/main/resources/application-secrets.properties
- name: Build with Maven
run: |
cd SkyShop
mvn package
- name: Deploy to Railway
run: |
npx railway up
env:
RAILWAY_API_TOKEN: ${{ secrets.RAILWAY_API_TOKEN }}