SWEBP-001: Init node app #9
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
| # 1. Correr Tests en cada PR | |
| # 2. Si tests corren bien, deployear a entorno de dev | |
| name: CI/CD on Pull request | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| build_test_js_app: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install dependencies | |
| run: | | |
| npm install | |
| working-directory: swe-bp | |
| - name: Run tests | |
| run: | | |
| npm test | |
| working-directory: swe-bp | |
| deploy_node_app: | |
| needs: build_test_js_app | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Install Heroku CLI | |
| run: | | |
| curl https://cli-assets.heroku.com/install.sh | sh | |
| - uses: akhileshns/heroku-deploy@v3.14.15 | |
| with: | |
| heroku_api_key: ${{ secrets.HEROKU_API_KEY_SWEBP }} | |
| heroku_app_name: "swe-bp" | |
| heroku_email: ${{ vars.HEROKU_USERNAME_SWEBP }} | |
| appdir: "swe-bp" |