Add environment banner #16
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: Test & Deploy | |
| # This action will be run on the `main` branch | |
| # or on any pull requests going into the `main` branch. | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| quality-control: | |
| name: Quality Control | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.13" | |
| - run: pip install -r requirements-dev.txt | |
| - run: ruff check . | |
| - run: ruff format --check . | |
| - run: python manage.py check | |
| - run: python manage.py makemigrations --check | |
| deploy: | |
| name: Deploy to CodeRed Cloud | |
| # Only run the deployment if the previous checks succeeded. | |
| needs: quality-control | |
| # Only run in the main branch (i.e. not pull requests). | |
| if: github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.13" | |
| # CodeRed Cloud command line tool. | |
| # See: https://www.codered.cloud/docs/cli/ | |
| - name: Install cr tool | |
| run: | | |
| pip install -r requirements.txt | |
| pip install cr | |
| # Run the deployment. | |
| - name: Deploy | |
| run: cr deploy demo-django | |
| env: | |
| CR_TOKEN: ${{ secrets.cr_token }} |