add option to setup roles + online demo #725
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: 🧪 Test and build Docker image | |
on: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- 'website/**' | |
- '.github/workflows/website.yml' | |
pull_request: | |
branches: | |
- master | |
paths-ignore: | |
- 'website/**' | |
- '.github/workflows/website.yml' | |
workflow_dispatch: | |
jobs: | |
docker-tests: | |
name: Docker | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "build dockerfile" | |
run: docker build -f .docker/Dockerfile --tag opengisch/signalo:unstable . | |
- name: "initialize container" | |
run: | | |
docker run -d -p 5432:5432 --name signalo opengisch/signalo:unstable | |
docker exec signalo init_db.sh wait | |
docker exec -e PGSERVICE=pg_signalo_demo signalo init_db.sh build -d | |
docker exec -e PGSERVICE=pg_signalo_demo signalo /src/scripts/all-signs.py | |
# - uses: actions/setup-node@v3 | |
# with: | |
# node-version: '18' | |
- name: "test data model" | |
run: docker exec signalo pytest | |
# - name: "test images" | |
# run: docker exec signalo /src/test/official_sign_images.sh | |
- name: "test changelog" | |
run: docker exec signalo /src/test/test-changelog.sh | |
# - name: "schema lint" | |
# run: | | |
# npm i --no-fund -g schemalint | |
# cp .schemalintrc.js.template .schemalintrc.js | |
# schemalint | |
- name: Login to DockerHub | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: "push to dockerhub" | |
if: github.event_name != 'pull_request' | |
run: | | |
docker push opengisch/signalo:unstable | |
- name: Deploy Demo DB | |
run: | | |
docker exec signalo pg_dump --format custom --exclude-schema=public --blobs --compress 5 --file signalo | |
docker cp signalo:/src/signalo-testing-db-dump-with-demo.backup signalo-testing-db-dump-with-demo.backup | |
pg_restore --host=${DEMO_DB_HOST} --username=${DEMO_DB_USER} --port=${DEMO_DB_PORT} --dbname==${DEMO_DB_TESTING} --exit-on-error --clean --if-exists --no-owner signalo-testing-db-dump-with-demo.backup | |
psql --host=${DEMO_DB_HOST} --username=${DEMO_DB_USER} --port=${DEMO_DB_PORT} --dbname=${DEMO_DB_TESTING} -v EXIT_ON_ERROR=on -f ./datamodel/roles.sql | |
- name: "failure logs" | |
if: failure() | |
run: | | |
docker logs signalo |