Skip to content

Update docker.yml

Update docker.yml #4

Workflow file for this run

name: Build and push docker image
on:
push:
pull_request:
schedule:
- cron: '0 0 * * 1'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Update submodule
run: |
git submodule update --init --recursive
- name: Build images
run: |
docker compose build
working-directory: qhhoj
- name: Test images
run: |
./scripts/init
docker compose up -d
sleep 10
COMPOSE_EXEC_FLAGS="-T" ./scripts/copy_static
COMPOSE_EXEC_FLAGS="-T" ./scripts/migrate
COMPOSE_EXEC_FLAGS="-T" ./scripts/manage.py loaddata language_small
- name: Push images to Docker
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/master'
run: |
echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
docker push qhhoj/qhhoj-base:latest
docker push qhhoj/qhhoj-pdfoid:latest
docker push qhhoj/qhhoj-site:latest
docker push qhhoj/qhhoj-celery:latest
docker push qhhoj/qhhoj-bridged:latest
docker push qhhoj/qhhoj-wsevent:latest
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}