Deploy Spring Boot with Railway #66
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 Spring Boot with Railway | |
on: | |
workflow_run: | |
workflows: [ Publish Auction Backend Docker Image ] | |
types: | |
- completed | |
branches: | |
- main | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Build with Maven | |
run: mvn -B package -DskipTests --file pom.xml | |
deploy: | |
name: Deploy | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install Railway | |
run: npm i -g @railway/cli | |
- name: Deploy | |
run: railway up --service web | |
env: | |
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }} |