feat: Healthcheck, nginx fix, added tests for django #183
Workflow file for this run
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: Pull Request | |
on: | |
pull_request: | |
concurrency: | |
# PR open and close use the same group, allowing only one at a time | |
group: ${{ github.event.number }} | |
cancel-in-progress: true | |
jobs: | |
builds: | |
name: Builds | |
runs-on: ubuntu-22.04 | |
permissions: | |
packages: write | |
strategy: | |
matrix: | |
package: [frontend, rctool] | |
include: | |
- package: frontend | |
build_file: ./frontend/Dockerfile.nginx | |
- package: rctool | |
build_file: ./frontend/Dockerfile.app | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: bcgov-nr/[email protected] | |
with: | |
package: ${{ matrix.package }} | |
build_file: ${{ matrix.build_file }} | |
build_context: ./frontend | |
tag: ${{ github.event.number }} | |
tag_fallback: test | |
token: ${{ secrets.GITHUB_TOKEN }} | |
triggers: ('frontend/') | |
deploys: | |
name: Deploys | |
needs: [builds] | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
name: [frontend, rctool] | |
include: | |
- name: frontend | |
file: frontend/openshift.nginx.deploy.yml | |
- name: rctool | |
file: frontend/openshift.deploy.yml | |
steps: | |
- uses: bcgov-nr/[email protected] | |
with: | |
file: ${{ matrix.file }} | |
oc_namespace: ${{ secrets.OC_NAMESPACE }} | |
oc_server: ${{ vars.OC_SERVER }} | |
oc_token: ${{ secrets.OC_TOKEN }} | |
overwrite: true | |
parameters: | |
-p MIN_REPLICAS=1 -p MAX_REPLICAS=1 -p ZONE=${{ github.event.number }} | |
-p PROMOTE=${{ github.repository }}/${{ matrix.name }}:${{ github.event.number }} | |
tests: | |
name: Run Tests for Django App | |
needs: [deploys] | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Run Django Tests in frontend docker container | |
run: | | |
docker exec -it rctool /bin/bash -c "python manage.py test" | |
results: | |
name: PR Results | |
needs: [deploys] | |
runs-on: ubuntu-22.04 | |
steps: | |
- run: echo "Workflow completed successfully!" |