Deploy on ghcr.io #268
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: cicd_light | |
on: | |
# Run tests for non-draft pull request on dev | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build_and_test: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
services: | |
database: | |
image: gpao/database:0.17.0 | |
env: | |
POSTGRES_PASSWORD: postgres | |
ports: | |
- 5432:5432 | |
api-gpao: | |
image: gpao/api-gpao:1.30.0 | |
env: | |
PGHOST: database | |
PGPORT: 5432 | |
PGUSER: postgres | |
PGPASSWORD: postgres | |
PGDATABASE: gpao | |
ports: | |
- 8080:8080 | |
monitor-gpao: | |
image: gpao/monitor-gpao:1.46.0 | |
ports: | |
- 8000:8000 | |
steps: | |
- name: log GPAO database | |
shell: bash | |
run: docker logs "${{ job.services.database.id }}" | |
- name: log GPAO API | |
shell: bash | |
run: docker logs "${{ job.services.api-gpao.id }}" | |
- name: docker ps | |
shell: bash | |
run: docker ps | |
- name: test database connection | |
shell: bash | |
run: pg_isready -d gpao -h localhost -p 5432 -U postgres | |
- name: test API connection | |
shell: bash | |
run: curl http://localhost:8080/api/projects | |
- name: Checkout branch | |
uses: actions/checkout@v3 | |
# See https://github.com/marketplace/actions/setup-micromamba | |
- name: install | |
uses: mamba-org/[email protected] | |
with: | |
environment-file: environment.yml | |
environment-name: coclico # activate the environment | |
cache-environment: true | |
cache-downloads: true | |
generate-run-shell: true | |
- name: test unit | |
shell: micromamba-shell {0} | |
run: python -m pytest -m "not gpao" -s --log-cli-level DEBUG | |
- name: make docker local | |
shell: bash | |
run: make docker-build | |
- name: test GPAO | |
shell: micromamba-shell {0} | |
run: python -m pytest -m gpao -s --log-cli-level DEBUG | |