221 progress page badge widget (#295) #39
This file contains hidden or 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 to Railway | |
| on: | |
| push: | |
| branches: [ main, dev ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:12 | |
| env: | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: test_db | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 5432:5432 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '18.18.2' | |
| cache: 'yarn' | |
| - name: Install dependencies | |
| run: | | |
| cd backend && yarn install | |
| cd ../frontend && yarn install | |
| - name: Run backend tests | |
| run: | | |
| cd backend | |
| yarn lint | |
| env: | |
| DATABASE_URL: postgresql://postgres:postgres@localhost:5432/test_db | |
| - name: Run frontend tests | |
| run: | | |
| cd frontend | |
| yarn lint | |
| deploy: | |
| needs: test | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Deploy to Railway | |
| uses: railwayapp/railway-deploy@v1 | |
| with: | |
| railway-token: ${{ secrets.RAILWAY_TOKEN }} | |
| service: marillac-place | |