forked from agusegimenez/Skyshop_CTD
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cree un pipeline que crea las credenciales de Railway para la base de datos en el application-secrets.properties
- Loading branch information
1 parent
623c904
commit 169706f
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
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' | ||
|
||
- name: Create application-secrets.properties | ||
run: | | ||
echo "DB_URL=${{ secrets.DB_URL }}" >> SkyShop/src/main/resources/application-secrets.properties | ||
echo "DB_USERNAME=${{ secrets.DB_USERNAME }}" >> SkyShop/src/main/resources/application-secrets.properties | ||
echo "DB_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 }} |