Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 72 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
- release
pull_request:

env:
SHORT_SHA: ${GITHUB_SHA:0:7}

jobs:
lint:
if: '! github.event.pull_request.draft'
Expand Down Expand Up @@ -61,12 +64,78 @@ jobs:
sed -ri 's/^COMPOSE_FILE=(.*)/COMPOSE_FILE=\1:docker-compose.override.test.yml/g' .env
eval $(egrep "^[^#;]" .env | xargs -d'\n' -n1 | sed -E 's/(\w+)=(.*)/export \1='"'"'\2'"'"'/g')

- name: Login to GitHub Container Repository (ghcr.io)
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
buildkitd-flags: '--allow-insecure-entitlement network.host'
driver-opts: network=host

- name: Docker Build app
uses: docker/build-push-action@v6
with:
file: docker-app/Dockerfile
context: docker-app
push: false
load: true
allow: network.host
network: host
target: webserver_test
tags: qfieldcloud-app:latest
cache-from: type=registry,ref=ghcr.io/opengisch/qfieldcloud-app-test:buildcache
# cache-to: type=registry,ref=ghcr.io/opengisch/qfieldcloud-app-test:buildcache,mode=max

- name: Docker Build worker-wrapper
uses: docker/build-push-action@v6
with:
file: docker-app/Dockerfile
context: docker-app
push: false
load: true
allow: network.host
network: host
target: worker_wrapper_runtime
tags: qfieldcloud-worker_wrapper:latest
cache-from: type=registry,ref=ghcr.io/opengisch/qfieldcloud-worker-wrapper:buildcache
# cache-to: type=registry,ref=ghcr.io/opengisch/qfieldcloud-worker-wrapper:buildcache,mode=max

- name: Docker Build qgis
uses: docker/build-push-action@v6
with:
file: docker-qgis/Dockerfile
context: docker-qgis
push: false
load: true
allow: network.host
network: host
tags: qfieldcloud-qgis:latest
cache-from: type=registry,ref=ghcr.io/opengisch/qfieldcloud-qgis:buildcache
# cache-to: type=registry,ref=ghcr.io/opengisch/qfieldcloud-qgis:buildcache,mode=max

- name: Docker Build nginx
uses: docker/build-push-action@v6
with:
file: docker-nginx/Dockerfile
context: docker-nginx
push: false
load: true
allow: network.host
tags: qfieldcloud-nginx:latest
cache-from: type=registry,ref=ghcr.io/opengisch/qfieldcloud-nginx:buildcache
# cache-to: type=registry,ref=ghcr.io/opengisch/qfieldcloud-nginx:buildcache,mode=max

- name: Pull docker containers
run: docker compose pull

- name: Build and run docker containers
run: |
docker compose up -d --build
- name: Run docker containers
run: docker compose up -d

- name: Initial manage.py commands
run: |
Expand Down
Loading