forked from agusegimenez/Skyshop_CTD
-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (30 loc) · 1.05 KB
/
set-up.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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
run: |
echo "spring.datasource.url=jdbc:postgresql://${{ secrets.DB_HOST }}:${{ secrets.DB_PORT }}/railway" >> SkyShop/src/main/resources/application-secrets.properties
echo "spring.datasource.username=${{ secrets.DB_USER }}" >> SkyShop/src/main/resources/application-secrets.properties
echo "spring.datasource.password=${{ secrets.DB_PASSWORD }}" >> 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 }}