Build Docker Images #310
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: Build Docker Images | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: '0 0 * * 1' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Initialize submodules | |
run: | | |
git submodule update --init --recursive | |
- name: Build images | |
run: docker compose build | |
working-directory: dmoj | |
- name: Test images | |
run: | | |
./scripts/initialize | |
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 | |
working-directory: dmoj | |
- 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 ninjaclasher/dmoj-base:latest | |
docker push ninjaclasher/dmoj-texoid:latest | |
docker push ninjaclasher/dmoj-pdfoid:latest | |
docker push ninjaclasher/dmoj-mathoid:latest | |
docker push ninjaclasher/dmoj-site:latest | |
docker push ninjaclasher/dmoj-celery:latest | |
docker push ninjaclasher/dmoj-bridged:latest | |
docker push ninjaclasher/dmoj-wsevent:latest | |
env: | |
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} |