Wonters is testing out GitHub Actions π #26
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 alerting | |
| run-name: ${{ github.actor }} is testing out GitHub Actions π | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Install dependencies | |
| run: pip install -r requirements.txt | |
| - name: Show Pytest Version | |
| run: pytest --version | |
| - name: Run tests | |
| run: pytest tests.py | |
| deploy: | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - run: echo "π The job was automatically triggered by a ${{ github.event_name }} event." | |
| - run: echo "π§ This job is now running on a ${{ runner.os }} server hosted by GitHub!" | |
| - run: echo "π The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." | |
| - run: echo "π₯οΈ The workflow is now ready to test your code on the runner." | |
| - run: ssh -i ~/.ssh/id_rsa root@38.0.101.76 "cd /home/ubuntu/sentimental_analyses && git pull origin main && ./install.sh" |